 |
|
| Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more. |
|
 |

07-09-2012, 03:26 PM
|
 |
v7n Mentor
Latest Blog: None
|
|
Join Date: 10-12-09
Location: UK
Posts: 629
|
|
|
CSS IE issues - Feel like crying :(
I've worked really hard on my new style and have launched it tonight.
I have just noticed that it messes up in IE. Now I feel like crying, I hate IE.
I can't figure out how to fix the problems as I know IE is a bit of a funny one.
www.midwiferyonline.co.uk
For some reason the footer goes down the right hand side of the page, and on the right hand side where the 'blocks' are, the poll one (the very top block) spreads down behind all the others.
And the login box won't work, if you 'log in' it just doesn't log you in!
AGHHh!
It all looks fine in firefox though, I haven't checked any other browser.
|

07-09-2012, 04:37 PM
|
 |
Super Moderator
|
|
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 18,062
|
|
|
What version of IE are you viewing this in. IE9 it looks fine.
BTW: Your EU cookie thing isn't working for me. I clicked the check mark and it won't go away! Ok, not impressed, clicked X to get rid of it and was taken to Google.
|

07-10-2012, 01:54 AM
|
 |
Contributing Member
|
|
Join Date: 07-05-11
Location: philippines
Posts: 312
|
|
|
checked also in IE7 and 8 on Windows XP.. seems to be fine..
are you checking IE6 or this issues has been fixed?
|

07-10-2012, 03:03 AM
|
 |
v7n Mentor
Latest Blog: None
|
|
Join Date: 10-12-09
Location: UK
Posts: 629
|
|
I'm checking in ie 9.
So rry it's on the forum - http://www.midwiferyonline.co.uk/forum.php
The right hand bar and for some reason my footer goes up the right side!
|

07-12-2012, 02:07 AM
|
 |
Contributing Member
|
|
Join Date: 07-05-11
Location: philippines
Posts: 312
|
|
|
its not just IE 9, its also visible in FF. and it seems like there are some un-closed tags in your HTML. check the code of you items in the right column, there might be a div that is not closed.
|

07-13-2012, 12:49 PM
|
|
Super Moderator
Latest Blog: None
|
|
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 1,739
|
|
Well, i took a a look at the code to see if i could fix the problems, and came up with a temporary fix. I think in the long run, you should recode the right sidebar, as some of its code is a bit confusing.
To start, i only have the static copy of the frontpage of the forum to work with, so you will need to figure out how to add it in the php-code or post the php-code making up the sidebar.
I have added the missing code the way i think is correct, not necessary to be confused with the way there is correct ;-)
Find:
Code:
<div align="center"><a href="showthread.php?t=4091"><span class="pollres">Poll:</span> <span class="pollquestionmain">Do you have faith in the NMC's process for investigating those accused of misconduct?</span></a></div>
Replace it with:
Code:
<div align="center"><a href="showthread.php?t=4091"><span class="pollres">Poll:</span> <span class="pollquestionmain">Do you have faith in the NMC's process for investigating those accused of misconduct?</span></a></div>
</form>
</div>
</div>
</div>
As you can see, there was a missing "</form>", as the poll have a start form-tag. The form don't look like it's being used, so you could probably remove the start form-tag and not add the end form-tag, but some of your pages look like they have a poll where you can vote, and that might need the form, so i just chose to close the form. Then added a few end divs to prevent the other sidebar widget to be in the same container as the poll.
Find:
Code:
<script type="text/javascript" src="http://cdn.socialmediatabs.com/loader/loader.1.0.min.js"></script>
<!-- SocialMediaTabs.com STOP -->
<div style="clear: left">
Replace it with:
Code:
<script type="text/javascript" src="http://cdn.socialmediatabs.com/loader/loader.1.0.min.js"></script>
<!-- SocialMediaTabs.com STOP -->
</li>
</ul>
</div>
<div style="clear: left">
The sidebar uses two unordered list, however only the last list was closed, meaning, all code below the sidebar(the footer), would be shown below the sidebar as a part of the not closed lists. So added code to close list item and the list itself, and added closing div, as the sidebar is started with a div that needs to be closed.
When you have added that code i only see two small issues, the space between the poll and "subscribe" widgets is a bit smaller than the other widgets, but it should be fairly simple to add margin-bottom to the poll containing div, and the other issue is with "users online" box, the is some space to the bottom graphic, but i haven't really looked in to that, as i didn't see it as a big issue.
Anyway, tested the static page(with my added code) in latest versions of Firefox, Internet Explorer, Chrome and Opera, and only found those two small issues i already have mentioned.
|

07-16-2012, 10:30 AM
|
 |
v7n Mentor
Latest Blog: None
|
|
Join Date: 10-12-09
Location: UK
Posts: 629
|
|
Regarding the first bit, yes I can see now that it's the poll side block which is interferring with the footer.
However if I change to what you have said it buts the poll block into it's own block and puts the footer where it should be but it doesn't show any of the poll options.
Here is the code for that template -
Code:
<div>
<form class="block" action="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}poll.php?do=pollvote&pollid={vb:raw pollinfo.pollid}" method="post">
<div align="center"><a href="showthread.php?{vb:raw session.sessionurl}t={vb:raw pollinfo.threadid}"><span class="pollres">{vb:rawphrase poll}:</span> <span class="pollquestionmain">{vb:raw pollinfo.question}</span></a>
<vb:if condition="$show['editpoll']"><a href="{vb:link poll, {vb:raw pollinfo}, 'do=polledit'}"><img class="inlineimg" src="{vb:stylevar imgdir_cms}/edit_small.png" alt="{vb:rawphrase edit_poll}" title="{vb:rawphrase edit_poll}"/></a>
</vb:if></div>
<div style="margin-top:10px;">
<ul class="checkradio group">
{vb:raw pollbits}
</ul>
</div>
<div class="pollbuttons" align="center">
<input type="submit" class="button" value="{vb:rawphrase vote_now}" tabindex="1" />
<a class="textcontrol" href="{vb:link poll, {vb:raw pollinfo}, 'do=showresults'}">{vb:rawphrase view_poll_results}</a>
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="do" value="pollvote" />
<input type="hidden" name="pollid" value="{vb:raw pollinfo.pollid}" />
</div>
<vb:if condition="$show['publicwarning']"><div><br><i>{vb:rawphrase public_poll_users_see_choices}</i></div></vb:if>
<vb:if condition="$show['pollenddate']"><div><br><i>{vb:rawphrase this_poll_will_close_on_x_at_y, {vb:raw pollenddate}, {vb:raw pollendtime}}</i></div></vb:if>
</form>
</div>
I appreciate your help as I'm stuck. I'm looking at the other bits now.
|

07-16-2012, 05:10 PM
|
|
Super Moderator
Latest Blog: None
|
|
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 1,739
|
|
|
It looks like the problem is php related, looking at the poll code, something goes wrong with "{vb:raw pollbits}", preventing the rest of the poll code to be writen to the web browser. So thats why, the end form, end list etc. couldn't be found in the xhtml source code.
So you don't need the other code i posted, when you find out what goes wrong with the poll php code, i think everything else will automatically fall in to place.
So not much more i can do to help, unless you post the php code for the poll.
Maybe you could turn php errors on temporary, to see if the script output some php error there can help you to solve the problem.
|

07-17-2012, 08:30 AM
|
 |
Contributing Member
|
|
Join Date: 07-11-10
Posts: 216
|
|
You can use modernizer javascript library that helps decreasing the messes of ie6 to ie8
hope it helps
|

08-02-2012, 08:05 AM
|
 |
v7n Mentor
Latest Blog: None
|
|
Join Date: 10-12-09
Location: UK
Posts: 629
|
|
Quote:
Originally Posted by J. H. Rasmussen
It looks like the problem is php related, looking at the poll code, something goes wrong with "{vb:raw pollbits}", preventing the rest of the poll code to be writen to the web browser. So thats why, the end form, end list etc. couldn't be found in the xhtml source code.
So you don't need the other code i posted, when you find out what goes wrong with the poll php code, i think everything else will automatically fall in to place.
So not much more i can do to help, unless you post the php code for the poll.
Maybe you could turn php errors on temporary, to see if the script output some php error there can help you to solve the problem.
|
I'm still having trouble with this.
This is the PHP for the poll side block -
PHP Code:
global $vbulletin, $vbphrase, $db;
if ($vbulletin->options['poll_on_sideblock_vb4']) {
if (!empty($vbulletin->options['poll_on_sideblock_vb4_thread'])) {
$getthread = $db->query_first("SELECT threadid, pollid, forumid, open, lastpost FROM ".TABLE_PREFIX."thread where threadid = ".$vbulletin->options['poll_on_sideblock_vb4_thread']."");
}
elseif (!empty($vbulletin->options['poll_on_sideblock_vb4_forum'])) {
$getthread = $db->query_first("SELECT forum.forumid, thread.threadid, thread.pollid, thread.forumid, thread.open, thread.lastpost FROM ".TABLE_PREFIX."forum as forum
LEFT join ".TABLE_PREFIX."thread as thread ON thread.forumid = forum.forumid where forum.forumid IN (".$vbulletin->options['poll_on_sideblock_vb4_forum'].") ORDER BY thread.pollid DESC LIMIT 1");
}
$poll = '';
if ($getthread['pollid'])
{
$pollbits = '';
$counter = 1;
$pollid = $getthread['pollid'];
$show['editpoll'] = iif(can_moderate($getthread['forumid'], 'caneditpoll'), true, false);
// get poll info
$pollinfo = $db->query_first_slave("
SELECT *
FROM " . TABLE_PREFIX . "poll
WHERE pollid = $pollid
");
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$pollinfo['question'] = $bbcode_parser->parse(unhtmlspecialchars($pollinfo['question']), $getthread['forumid'], true);
$splitoptions = explode('|||', $pollinfo['options']);
$splitoptions = array_map('rtrim', $splitoptions);
$splitvotes = explode('|||', $pollinfo['votes']);
$showresults = 0;
$uservoted = 0;
$forumperms = fetch_permissions($getthread['forumid']);
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canvote']))
{
$nopermission = 1;
}
if (!$pollinfo['active'] OR !$getthread['open'] OR ($pollinfo['dateline'] + ($pollinfo['timeout'] * 86400) < TIMENOW AND $pollinfo['timeout'] != 0) OR $nopermission)
{
//thread/poll is closed, ie show results no matter what
$showresults = 1;
}
else
{
//get userid, check if user already voted
$voted = intval(fetch_bbarray_cookie('poll_voted', $pollid));
if ($voted)
{
$uservoted = 1;
}
}
if ($pollinfo['timeout'] AND !$showresults)
{
$pollendtime = vbdate($vbulletin->options['timeformat'], $pollinfo['dateline'] + ($pollinfo['timeout'] * 86400));
$pollenddate = vbdate($vbulletin->options['dateformat'], $pollinfo['dateline'] + ($pollinfo['timeout'] * 86400));
$show['pollenddate'] = true;
}
else
{
$show['pollenddate'] = false;
}
foreach ($splitvotes AS $index => $value)
{
$pollinfo['numbervotes'] += $value;
}
if ($vbulletin->userinfo['userid'] > 0)
{
$pollvotes = $db->query_read_slave("
SELECT voteoption
FROM " . TABLE_PREFIX . "pollvote
WHERE userid = " . $vbulletin->userinfo['userid'] . " AND pollid = $pollid
");
if ($db->num_rows($pollvotes) > 0)
{
$uservoted = 1;
}
}
if ($showresults OR $uservoted)
{
if ($uservoted)
{
$uservote = array();
while ($pollvote = $db->fetch_array($pollvotes))
{
$uservote["$pollvote[voteoption]"] = 1;
}
}
}
$left = vB_Template_Runtime::fetchStyleVar('left');
$right = vB_Template_Runtime::fetchStyleVar('right');
$option['open'] = $left[0];
$option['close'] = $right[0];
foreach ($splitvotes AS $index => $value)
{
$arrayindex = $index + 1;
$option['uservote'] = iif($uservote["$arrayindex"], true, false);
$option['question'] = $bbcode_parser->parse($splitoptions["$index"], $getthread['forumid'], true);
// public link
if ($pollinfo['public'] AND $value)
{
$option['votes'] = '<a href="' . fetch_seo_url('poll', $pollinfo, array('do' => 'showresults')) .
'">' . vb_number_format($value) . '</a>';
}
else
{
$option['votes'] = vb_number_format($value); //get the vote count for the option
}
$option['number'] = $counter; //number of the option
//Now we check if the user has voted or not
if ($showresults OR $uservoted)
{ // user did vote or poll is closed
if ($value <= 0)
{
$option['percentraw'] = 0;
}
else if ($pollinfo['multiple'])
{
$option['percentraw'] = ($value < $pollinfo['voters']) ? $value / $pollinfo['voters'] * 100 : 100;
}
else
{
$option['percentraw'] = ($value < $pollinfo['numbervotes']) ? $value / $pollinfo['numbervotes'] * 100 : 100;
}
$option['percent'] = vb_number_format($option['percentraw'], 2);
$option['graphicnumber'] = $option['number'] % 6 + 1;
$option['barnumber'] = round($option['percent']) * 2;
$option['remainder'] = 201 - $option['barnumber'];
// Phrase parts below
if ($nopermission)
{
$pollstatus = $vbphrase['you_may_not_vote_on_this_poll'];
}
else if ($showresults)
{
$pollstatus = $vbphrase['this_poll_is_closed'];
}
else if ($uservoted)
{
$pollstatus = $vbphrase['you_have_already_voted_on_this_poll'];
}
$templater = vB_Template::create('sideblock_pollresult');
$templater->register('names', $names);
$templater->register('option', $option);
$pollbits .= $templater->render();
}
else
{
if ($pollinfo['multiple'])
{
$templater = vB_Template::create('sideblock_polloption_multiple');
$templater->register('option', $option);
$pollbits .= $templater->render();
}
else
{
$templater = vB_Template::create('sideblock_polloption');
$templater->register('option', $option);
$pollbits .= $templater->render();
}
}
$counter++;
}
if ($pollinfo['multiple'])
{
$pollinfo['numbervotes'] = $pollinfo['voters'];
$show['multiple'] = true;
}
if ($pollinfo['public'])
{
$show['publicwarning'] = true;
}
else
{
$show['publicwarning'] = false;
}
$displayed_dateline = $getthread['lastpost'];
$pollinfo['threadid'] = $getthread['threadid'];
if ($showresults OR $uservoted)
{
$templater = vB_Template::create('sideblock_pollresults_table');
$templater->register('pollbits', $pollbits);
$templater->register('pollenddate', $pollenddate);
$templater->register('pollendtime', $pollendtime);
$templater->register('pollinfo', $pollinfo);
$templater->register('show', $show);
$templater->register('pollstatus', $pollstatus);
$poll = $templater->render();
}
else
{
$templater = vB_Template::create('sideblock_polloptions_table');
$templater->register('pollbits', $pollbits);
$templater->register('pollenddate', $pollenddate);
$templater->register('pollendtime', $pollendtime);
$templater->register('show', $show);
$templater->register('pollinfo', $pollinfo);
$poll = $templater->render();
}
return $poll;
}
}
else {
}
|

08-06-2012, 03:29 AM
|
|
Super Moderator
Latest Blog: None
|
|
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 1,739
|
|
|
Sorry for the late reply, but i have had a few busy days, and it toke a little time to look at the code.
Anyway, looking at the php code, it's a bit diffecult to test where there migt be a problem, since i can't just upload the code to my own server and test out what goes wrong.
As expected, the poll code is added to the template before send to the web browser, so maybe the problem is that you use an incompatible vBulletin template/theme.
You could also take a look at what is the difference between the poll code on the frontpage and the forum pages. The template code seem to match the poll code on the forum pages, but not the poll code on the frontpage.
Maybe the poll software is incompatible with some vBulletin add-ons/plug-ins. You could try to disable other add-ons/plug-ins, and see if there is still problems with the poll.
Posting the working php poll code from the frontpage might help, since we could then compare the working and not working poll code.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 03:14 PM.
Powered by vBulletin Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP
|
|
|