vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Help : customise block in the sidebare (https://vborg.vbsupport.ru/showthread.php?t=293516)

Christos Teriakis 01-02-2013 05:08 PM

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

tounet 01-02-2013 06:56 PM

Quote:

Originally Posted by Lynne (Post 2394261)
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 (Post 2394285)
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

tounet 01-02-2013 08:55 PM

1 Attachment(s)
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


All times are GMT. The time now is 01:36 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.00995 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete