Announcement

Collapse
No announcement yet.

[codeing] What is the syntax of vB_Template and how does it work, when i replace it

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [CMS] [codeing] What is the syntax of vB_Template and how does it work, when i replace it

    All previous mods, when fetching data from db

    i eval and use fetch template
    then print eval..

    But since vb4 thats not possible anymore..

    the infamous parse error is a pain

    Warning: fetch_template() calls should be replaced by the vB_Template class in [path]/includes/functions.php on line

    and searching vbcom and vborg = nothing but people with the problem when they run
    a vb3 mod on a vb4 board..

    Say i got this line and want to upgrade that to vb4 how would i proceed ?

    PHP Code:
    if ($_REQUEST['do'] == 'main')
    {
    $emailresult =$vbulletin->db->query_read("SELECT userid, username, email FROM " TABLE_PREFIX "user ORDER BY userid");
    while (
    $row $vbulletin->db->fetch_array($emailresult))
      {
          
    $userid htmlspecialchars_uni($row['userid']);
        
    $username htmlspecialchars_uni($row['username']);
        
    $usermail htmlspecialchars_uni($row['email']);
     
        eval(
    '$dbtestdata("' fetch_template('$dbtestrow') . '");');
      }
     
    eval(
    'print_output("' fetch_template('dbtesttemplate') . '");');
     


    Thinking the last eval should be replaced with

    PHP Code:
    $templater vB_Template::create('dbtesttemplate');
     
    $templater->register_page_templates();
     
    $templater->register('navbar'$navbar);
     
    $templater->register('pagetitle'$pagetitle);
     
    print_output($templater->render()); 
    Thanks in advance.
    similar Q on vborg
    Vbulletin fan

  • #2
    Check out the following blog entry http://www.vbulletin.com/forum/entry...in-vBulletin-4
    while(true){
    if(
    $someone->needsHelp() && $i->canHelp()) $post->help();
    if(
    $i->findBug()) $post->bug();
    }

    Comment

    Related Topics

    Collapse

    Working...
    X