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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2005, 04:51 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default template not echoing out

PHP Code:
 // random profile
     
$randprof $DB_site->query_first("
                                         SELECT *
                                         FROM user
                                         LEFT JOIN userfield ON (userfield.userid = user.userid)
                                         WHERE user.userid > 0 AND user.usergroupid <> 10 AND user.usergroupid <> 11 AND user.posts > 0
                                         GROUP BY user.userid
                                         ORDER BY rand()
                                         LIMIT 4
                                     "
);
 
     while (
$randprofinfo $DB_site->fetch_array($randprof))
     {
         
$rpusername $randprofinfo['username'];
         if (
$randprofinfo['userid']!=0)
         {
             if (
$randprofinfo[photos])
             {
                 
$pictureurl fetch_cachedgallerypicture_url($userinfo[userid]); 
                 if (
file_exists($pictureurl))
                 {
                         
$avatarimage "<img src=\"" $pictureurl "\" border=\"0\" alt=\"" $rpusername "\" />";
                 }
             }
             else
             {
                 
$avatarurl=fetch_cachedavatar_url($randprofinfo['userid']);
                 if (
$avatarurl == "")
                 {
                     
$avatarurl "" $vboptions[bburl] . "/" $stylevar[imgdir_misc] . "/noavatar.gif";
                     
$avatarimage "<img src=\"" $avatarurl "\" border=\"0\" alt=\"" $rpusername "\" />";
                 }
                 else
                 {
                     
$avatarurl "" $vboptions[bburl] . "/" $stylevar[imgdir_misc] . "guestavatar.gif";
                     
$avatarimage "<img src=\"" $avatarurl "\" border=\"0\" style=\"filter:alpha(opacity=50)\" alt=\"" $rpusername "\" />";
                 }
             }
         }
         
         if (!
$year)
         {
             
$year vbdate('Y'TIMENOWfalsefalse);
             
$month vbdate('n'TIMENOWfalsefalse);
             
$day vbdate('j'TIMENOWfalsefalse);
         }
 
         if (empty(
$gotage["$randprofinfo[userid]"]))
         {
             
$date explode('-'$randprofinfo['birthday']);
             if (
$year $date[2] AND $date[2] != '0000')
             {
                 
$randprofinfo['age'] = $year $date[2];
                 if (
$month $date[0] OR ($month == $date[0] AND $day $date[1]))
                 {
                     
$randprofinfo['age']--;
                 }
 
                 if (
$randprofinfo['age'] < 101)
                 {
                     
$gotage["$randprofinfo[userid]"] = $randprofinfo['age'];
                 }
                 else
                 {
                     unset(
$randprofinfo['age']);
                 }
             }
             else
             {
                 
$randprofinfo['age'] = $gotage["$randprofinfo[userid]"];
             }
         }
 
         if (
$randprofinfo[field24] != "")
         {
             
$randprofinfo2[field24] = "<img src=\"$vboptions[bburl]/$stylevar[imgdir_misc]/$randprofinfo[field24].gif\" />";
         }
 
         
$show[age] = "" $randprofinfo['age'] . "/";
         
$show[gender] = "" $randprofinfo2['field24'] . "/";
         
$show[location] = "" $randprofinfo['field2'] . "";
         
//$profilebits = "TESTING";
         
eval('$profilebits .= "' fetch_template("siteindex_profilebits") . '";');
     }
     eval(
'$siteindex_profile .= "' fetch_template("siteindex_profile") . '";'); 
i have no idea what's wrong with this.
Reply With Quote
  #2  
Old 01-05-2005, 05:13 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You haven't actually got an eval statement which echoes?
Reply With Quote
  #3  
Old 01-05-2005, 05:14 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sure that
PHP Code:
eval('$siteindex_profile .= "' fetch_template("siteindex_profile") . '";'); 
is not intendet to be

PHP Code:
eval('print_output("' fetch_template("siteindex_profile") . '");'); 
Reply With Quote
  #4  
Old 01-05-2005, 05:58 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

shouldn't the print_output by the final/master template for the page? this is just for a table in a page.
Reply With Quote
  #5  
Old 01-05-2005, 06:21 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

found it, query_first should've been query
Reply With Quote
  #6  
Old 01-05-2005, 06:24 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yep, right
Reply With Quote
  #7  
Old 01-05-2005, 07:52 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[high]* Dean C slaps everyone in this thread including himself [/high]
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 05:22 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08912 seconds
  • Memory Usage 2,264KB
  • Queries Executed 13 (?)
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
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete