I have a php file inspire the product "
Rate My Photo (HorOrNot Clone)" and correctly displays the best picture of my database and uses a template but I am unable to make my block:
the php code
PHP Code:
<?php
global $vbulletin;
// Include Globals
require_once('./global.php');
$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);
print_output($templater->render());
?>
the template :
HTML Code:
<li>
<div class="block smaller">
<div class="blocksubhead">
Meilleur photo
</div>
<div id="block_title" class="blockbody floatcontainer" {vb:raw content.style}>
<div class="blockrow">
<img src="../forum/ratemyphoto/photo/thumbs/{vb:raw bestphotoname}"/>
</div>
</div>
</div>
<div class="underblock"></div>
</li>
</div>
</div>
</div>
<div class="underblock"></div>