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

Reply
 
Thread Tools Display Modes
  #11  
Old 01-02-2013, 05:08 PM
Christos Teriakis Christos Teriakis is offline
 
Join Date: Jul 2011
Location: Thessaloniki, Greece
Posts: 1,228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was out for holidays, so just seen it (in my site too). As I'm still out of my working area, the only that I can say for now is that you've an error in configuration. Is PHP block and not HTML.
For more, a bit later...

Chris
Reply With Quote
  #12  
Old 01-02-2013, 06:56 PM
tounet's Avatar
tounet tounet is offline
 
Join Date: May 2007
Location: Algeria
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Replace this line:
PHP Code:
    return $templater->render(); 
With these:
PHP Code:
    $my_output $templater->render();
    return 
$my_output
And Kevin is correct in that your html template is improper html. I have no idea what it will do to the page if you leave it like that.

Thank you for your reply but its not working

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

Quote:
Originally Posted by ChrisTERiS View Post
I was out for holidays, so just seen it (in my site too). As I'm still out of my working area, the only that I can say for now is that you've an error in configuration. Is PHP block and not HTML.
For more, a bit later...

Chris
Thank you for your reply and I look forward
Reply With Quote
  #13  
Old 01-02-2013, 08:55 PM
tounet's Avatar
tounet tounet is offline
 
Join Date: May 2007
Location: Algeria
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This post can be closed because I finally found the solution

PHP Code:
global $vbulletin;

$bestphoto =$vbulletin->db->query_first("SELECT * FROM vb_ratemyphoto_photos WHERE approved=1 AND hidden=0 

AND rating>0 ORDER BY rating DESC, votes DESC LIMIT 1"
);
    
$besttitle htmlspecialchars_uni($bestphoto["title"]);
    
$bestphotoname $bestphoto["logo"];
    
$bestvotes $bestphoto["votes"];
    
$bestrating $bestphoto["rating"];
        
$templater vB_Template::create('block_photo');
        
$templater->register('besttitle'$besttitle);
    
$templater->register('bestphotoname'$bestphotoname);
        
$templater->register('bestvotes'$bestvotes);
    
$templater->register('bestrating'$bestrating);
    
$templater->register('bestuserid'$bestphoto[userid]);
    
$templater->register('bestusername'$bestphoto[username]);    
    
$templater->register('catid'$catid);
    return 
$templater->render(); 
created template called "block_photo"
PHP Code:
Member: <a href="member.php?u={vb:raw bestuserid}&tab=ratemyphoto#ratemyphoto">{vb:raw bestusername}</a><br />
Nb rate: <b>{vb:raw bestvotes}</b><br />
Best rate: <b>{vb:raw bestrating}</b
setting:
Title : The best Photo
Description : The best photo enacted by Member ratemyphoto
Active : Yes
Content Type : php
Content : code php " Top "
Template to Use : block_html

Attachment 143157
Reply With Quote
Благодарность от:
kh99
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 03:25 AM.


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.03837 seconds
  • Memory Usage 2,219KB
  • Queries Executed 12 (?)
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
  • (4)bbcode_php
  • (2)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
  • (1)pagenav_pagelink
  • (3)post_thanks_box
  • (1)post_thanks_box_bit
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)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_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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete