Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 09-25-2008, 03:24 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah ha! This is where you are going wrong:
<?php include("mypoll.php"); ?>
(I think that's the one.)

Look at what it spits out. It starts with an <html> tag again (and another <head> and <body> tag)
Reply With Quote
  #12  
Old 09-25-2008, 03:30 PM
legionofangels's Avatar
legionofangels legionofangels is offline
 
Join Date: Mar 2007
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<?php

//uncomment this and then change the directory if this is above your forums directory
//chdir('./forums');
require_once ('./global.php');

require_once (
'./includes/functions_bigthree.php');
require_once (
'./includes/functions_misc.php');
require_once (
'./includes/class_bbcode.php');

$poll mypoll();
echo 
$poll;


function 
mypoll()
{
    global 
$vbulletin$stylevar$vbphrase;
    
$query = array();
    
$query['orderby'] = 'poll.dateline';
    
$query['sortorder'] = 'DESC';
    
$pollforumids1 = array(16,17,18,19,20,21,23,24,25,26,28,29,30,31,32,2,3,4,5,7,8,9,10,12,13,14,34,35,36,37,40,54,198,153,200);
    
$pollforumids = array();
    foreach (
$pollforumids1 as $key => $pollforumid)
    {
        
$pollforumids[$key] = trim($pollforumid);
    }
    
$mods['inforums'] = 'AND thread.forumid IN(' implode(','$pollforumids) . ')';
    if (
$vbulletin->userinfo['userid'])
    {
        
$query['pollfields'] = ', voteoption';
        
$query['polljoin'] = 'LEFT JOIN ' TABLE_PREFIX .
            
'pollvote AS pollvote ON (pollvote.pollid = poll.pollid AND pollvote.userid = ' .
            
$vbulletin->userinfo['userid'] . ')';
    }
    
$pollinfo $vbulletin->db->query_first("
        SELECT thread.pollid, open, threadid, replycount, forumid, question, poll.dateline, options, votes, active, numberoptions, timeout, multiple, voters, public 
$query[pollfields]
        FROM " 
TABLE_PREFIX "poll AS poll
        INNER JOIN " 
TABLE_PREFIX "thread AS thread USING (pollid)
        
$query[polljoin]
        WHERE open <> 10 
        AND visible = 1 
        AND active = 1
        
$mods[inforums]
        ORDER BY 
$query[orderby] $query[sortorder]
    "
);
    if (
$pollinfo['pollid'])
    {
        
$bbcode_parser = &new vB_BbCodeParser($vbulletinfetch_tag_list());
        
$pollinfo['question'] = $bbcode_parser->parse($pollinfo['question'], 'nonforum'true);

        
$splitoptions explode('|||'$pollinfo['options']);
        
$splitvotes explode('|||'$pollinfo['votes']);

        
$pollinfo['nvotes'] = iif($pollinfo['multiple'], $pollinfo['voters'], array_sum
            
($splitvotes));

        
$pollforumperms fetch_permissions($pollinfo['forumid']);

        if (!
$pollinfo['active'] or !$pollinfo['open'] or ($pollinfo['dateline'] + ($pollinfo['timeout'] *
            
86400) < TIMENOW and $pollinfo['timeout']) or !($pollforumperms $vbulletin->bf_ugp_forumpermissions['canvote']))
        {
            
$pollinfo['showresults'] = 1;

            
$pollinfo['message'] = iif(($pollforumperms $vbulletin->bf_ugp_forumpermissions['canvote']),
                
$vbphrase['this_poll_is_closed'], $vbphrase['you_may_not_vote_on_this_poll']);
        }

        if (
fetch_bbarray_cookie('poll_voted'$pollinfo['pollid']) or $pollinfo['voteoption'])
        {
            
$pollinfo['showresults'] = 1;
            
$pollinfo['message'] = $vbphrase['you_have_already_voted_on_this_poll'];
        }

        if (
can_moderate($pollinfo['forumid'], 'caneditpoll'))
        {
            
$show['editpoll'] = true;
        }

        
$pollbits '';
        
$option '';
        foreach (
$splitvotes as $key => $value)
        {
            
$option['question'] = $bbcode_parser->parse($splitoptions["$key"], ''$mod_options['portal_poll_allowsmilies']);
            
$show['voteital'] = '';

            if (
$pollinfo['voteoption'] == ($key 1))
            {
                
$show['voteital'] = 1;
            }

            
$option['votes'] = $value;
            
$option['number'] = $key 1;

            if (
$pollinfo['showresults'])
            {
                
$option['percent'] = 0;
                if (
$value)
                {
                    
$option['percent'] = vb_number_format($value $pollinfo['nvotes'] * 1002);
                }

                
$option['graphicnumber'] = $option['number'] % 1;
                
$option['barnumber'] = intval($option['percent'] * 1.4);

                eval(
'$pollbits .= "' fetch_template('adv_portal_pollresult') . '";');
            } elseif (
$pollinfo['multiple'])
            {
                eval(
'$pollbits .= "' fetch_template('adv_portal_polloption_multiple') . '";');
            }
            else
            {
                eval(
'$pollbits .= "' fetch_template('adv_portal_polloption') . '";');
            }
        }
        
//eval('$polltotal .= "' . fetch_template('adv_portal_poll') . '";');
        
$polltotal .= "<form method=\"post\" action=\"./poll.php\">";
        
$polltotal .= "<table>";
        
$polltotal .= "<tr>";
        
$polltotal .= "<td class=\"thead\">" $pollinfo['question'] . "</td>";
        
$polltotal .= "</tr>";
        
$polltotal .= $pollbits;
        
$polltotal .= "<tr>";
        
$polltotal .= "<td align=\"" $stylevar['left'] . "\" class=\"alt1\">";
        if (
$pollinfo['showresults'])
        {
            
$polltotal .= "<span class=\"smallfont\"><b>" $vbphrase['votes'] . ": " $pollinfo['nvotes'] .
                
"</b><br />" $pollinfo['message'] . ".</span>";
        }
        else
        {
            
$polltotal .= "<input name=\"s\" type=\"hidden\" value=\"" $vbulletin->session->vars['dbsessionhash'] .
                
"\" />";
            
$polltotal .= "<input name=\"do\" type=\"hidden\" value=\"pollvote\" />";
            
$polltotal .= "<input type=\"hidden\" name=\"securitytoken\" value=\"" $vbulletin->userinfo['securitytoken'] .
                
"\" />\n";
            
$polltotal .= "<input name=\"pollid\" type=\"hidden\" value=\"" $pollinfo['pollid'] .
                
"\" />";
            
$polltotal .= "<input class=\"button\" name=\"button\" type=\"submit\" value=\"" .
                
$vbphrase['vote_now'] . "\" />";
        }
        
$polltotal .= "</td>";
        
$polltotal .= "</tr>";
        
$polltotal .= "<tr>";
        
$polltotal .= "<td class=\"alt2\">";
        
$polltotal .= "<div class=\"smallfont\">&raquo; <a href=\"" $vbulletin->options['bburl'] .
            
"/poll.php?" $vbulletin->session->vars['sessionurl'] .
            
"do=showresults&amp;pollid=" $pollinfo['pollid'] . "\">" $vbphrase['view_poll_results'] .
            
"</a></div>";
        if (
$mod_options['portal_poll_allowreplies'])
        {
            
$polltotal .= "<div class=\"smallfont\">&raquo; <a href=\"" $vbulletin->options['bburl'] .
                
"/newreply.php?" $vbulletin->session->vars['sessionurl'] . "t=" $pollinfo['threadid'] .
                
"\">" $vbphrase['discuss_this_poll'] . "</a></div>";
            
$polltotal .= "<div class=\"smallfont\">&raquo; <a href=\"" $vbulletin->options['bburl'] .
                
"/showthread.php?" $vbulletin->session['sessionurl'] . "t=" $pollinfo['threadid'] .
                
"\">" $vbphrase['this_poll_has'] . " " $pollinfo['replycount'];
            if (
$pollinfo['replycount'] == 1)
            {
                
$polltotal .= $vbphrase['reply'];
            }
            else
            {
                
$polltotal .= $vbphrase['replies'];
            }
            
$polltotal .= "</a></div>";
        }

        if (
$show['editpoll'])
        {
            
$polltotal .= "<div class=\"smallfont\">&raquo; <a href=\"" $vbulletin->options['bburl'] .
                
"/poll.php?" $vbulletin->session->vars['sessionurl'] .
                
"do=polledit&amp;pollid=" $pollinfo['pollid'] . "\">" $vbphrase['edit_poll'] .
                
"</a></div>";
        }
        
$polltotal .= "</td>";
        
$polltotal .= "</tr>";
        
$polltotal .= "</table>";
        
$polltotal .= "</form>";
        return 
$polltotal;

    }
}

?>
There is the mypoll.php, what should we modify?

Thanks for your help so far, but we're still not seeing what the problem is.
Reply With Quote
  #13  
Old 09-25-2008, 03:39 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What do the templates look like - adv_portal_pollresult, etc.? Do they start with the <html> tag?


To see the problem, view your page source right after you spit out the showthread pages and you'll see this:
HTML Code:
<div class="content" style="position:relative;float:left;background-color:white;left:71px;"> 

<html dir="" lang="">
<head>


	<title>Legion of Angels Forums</title>

</head>
<body>


<br /><br /><br />


<table class="tborder" cellpadding="" cellspacing="" border="0" width="70%" align="center">
<tr>
	<td class="tcat"></td>
</tr>
<tr>
	<td class="panelsurround" align="center">
	<div class="panel">
		<div align="">
	
				
			<!-- main error message -->
			
			
			<div style="margin: 10px">Unable to add cookies, header already sent.<br />
File: /homepages/26/d196297218/htdocs/index2.php<br />
Line: 8<br /></div>
			
				
			<!-- / main error message -->
Notice how you've got a whole page 'started' again in the middle of your page.
Reply With Quote
  #14  
Old 09-25-2008, 03:44 PM
legionofangels's Avatar
legionofangels legionofangels is offline
 
Join Date: Mar 2007
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is one of his templates:

adv_portal_polloption_multiple

HTML Code:
<tr>
<td class="$bgclass"><label for="pollchoice_$option[number]"><input id="pollchoice_$option[number]" name="optionnumber[$option[number]]" type="checkbox" value="yes" /> <span class="smallfont">$option[question]</span></label></td>
</tr>
--------------- Added [DATE]1222361256[/DATE] at [TIME]1222361256[/TIME] ---------------

I got a pm from someone on this, what if we put that code in the middle box in an iframe, will that fix the error?

It'll make that one section of the front page no content, but there will be a ton of other content in divs anyway.

--------------- Added [DATE]1222361393[/DATE] at [TIME]1222361393[/TIME] ---------------

This is:

adv_portal_poll

HTML Code:
<tr>
	<td class="thead">$pollinfo[question]</td>
</tr>

$pollbits

<tr>
	<td align="$stylevar[left]" class="$altbgclass">
		<if condition="$pollinfo['showresults']">
			<span class="smallfont"><b>$vbphrase[total_votes]: $pollinfo[nvotes]</b><br />$pollinfo[message].</span>
		<else />
			<input name="s" type="hidden" value="$session[dbsessionhash]" />
	<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
			<input name="do" type="hidden" value="pollvote" />
			<input name="pollid" type="hidden" value="$pollinfo[pollid]" />
			<input class="button" name="button" type="submit" value="$vbphrase[vote_now]" />
		</if>
	</td>
</tr>
<tr>
	<td class="$bgclass">
		<div class="smallfont">&raquo; <a href="$vboptions[bburl]/poll.php?$session[sessionurl]do=showresults&amp;pollid=$pollinfo[pollid]">$vbphrase[view_poll_results]</a></div>
		<if condition="$mod_options['portal_poll_allowreplies']">
			<div class="smallfont">&raquo; <a href="$vboptions[bburl]/newreply.php?$session[sessionurl]t=$pollinfo[threadid]">$vbphrase[discuss_this_poll]</a></div>
			<div class="smallfont">&raquo; <a href="$vboptions[bburl]/showthread.php?$sddession[sessionurl]t=$pollinfo[threadid]">$vbphrase[this_poll_has] $pollinfo[replycount] <if condition="$pollinfo['replycount'] == 1">$vbphrase[reply]<else />$vbphrase[replies]</if></a></div>
		</if>

		<if condition="$show['editpoll']">
			<div class="smallfont">&raquo; <a href="$vboptions[bburl]/poll.php?$session[sessionurl]do=polledit&amp;pollid=$pollinfo[pollid]">$vbphrase[edit_poll]</a></div>
		</if>
	</td>
</tr>
--------------- Added [DATE]1222361502[/DATE] at [TIME]1222361502[/TIME] ---------------

This is:

adv_portal_polloption

HTML Code:
<tr>
	<td class="$bgclass" valign="middle"><label for="pollchoice_$option[number]"><input id="pollchoice_$option[number]" name="optionnumber" type="radio" value="$option[number]" /><span class="smallfont">$option[question]</span></label></td>
</tr>
Reply With Quote
  #15  
Old 09-25-2008, 03:52 PM
Tact7626 Tact7626 is offline
 
Join Date: Feb 2007
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i can't find the culprits within the guys poll files/code. i thought he would have "echo:html"

the only echo's i see are

echo $poll;

are the double/body/headers coming from another template?
Reply With Quote
  #16  
Old 09-25-2008, 03:52 PM
legionofangels's Avatar
legionofangels legionofangels is offline
 
Join Date: Mar 2007
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is:

adv_portal_pollresult


HTML Code:
<tr>
	<td class="$bgclass">
		<span class="smallfont"><if condition="$show['voteital']"><em>$option[question] - $option[percent]%</em><else />$option[question] - $option[percent]%</if></span><br />
<img alt="" height="10" src="$stylevar[imgdir_poll]/bar$option[graphicnumber]-l.gif" width="3" /><img alt="$option[votes] <if condition="$option['votes'] <> 1">$vbphrase[votes]<else />$vbphrase[vote]</if>" height="10" src="$stylevar[imgdir_poll]/bar$option[graphicnumber].gif" width="$option[barnumber]" /><img alt="" height="10" src="$stylevar[imgdir_poll]/bar$option[graphicnumber]-r.gif" width="3" />
	</td>
</tr>
That is all the templates.
Reply With Quote
  #17  
Old 09-25-2008, 03:52 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I really don't know anything about iframes, so I don't know if that will fix the error. Did you look in the page source and see what I am talking about?
Reply With Quote
  #18  
Old 09-25-2008, 03:57 PM
Tact7626 Tact7626 is offline
 
Join Date: Feb 2007
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yep. we see it. were still trying to figure out what part of the mypoll.php is making it come out.

it's definately mypoll.php. but idk php so i don't know how he's making a whole new page echo out like that.
Reply With Quote
  #19  
Old 09-25-2008, 04:01 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm, I'm really not sure either. I guess I might go and compare mypoll.php to usage.php and see what the differences are.
Reply With Quote
  #20  
Old 09-25-2008, 04:02 PM
legionofangels's Avatar
legionofangels legionofangels is offline
 
Join Date: Mar 2007
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post

Also, you may want to correct this line (//feed2.js is incorrect):
HTML Code:
<script language="JavaScript" src="http://feed2js.org//feed2js.php?src=http%3A%2F%2Frss.cnn.com%2Frss%2Fcnn_showbiz.rss&amp;chan=title&amp;num=7&amp;desc=1" type="text/javascript"></script>
Those 3 feeds in the top 3 boxes will be replaced, it's jumbled at the moment the lower left box looks like unfinished code, but it's more like unfinished CSS, that works and will be applied to 5 off those 6 boxes in different arrays.

Quote:
Originally Posted by Lynne View Post
I really don't know anything about iframes, so I don't know if that will fix the error. Did you look in the page source and see what I am talking about?
I know even less than he does on the php. The iframe didn't work we isolated it to that bottom middle box and the 6th lower right box which disappears when we make the error occur is now back but the iframe is showing no data or information what so ever, just a blank white box. So the iframe didn't work either.

--------------- Added [DATE]1222362390[/DATE] at [TIME]1222362390[/TIME] ---------------

Quote:
Originally Posted by Lynne View Post
Hmmm, I'm really not sure either. I guess I might go and compare mypoll.php to usage.php and see what the differences are.
I think what you're basically saying is look for html in those php files? That shouldn't be there??
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:57 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02593 seconds
  • Memory Usage 2,395KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_html
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete