Quote:
Originally Posted by yilmaz
Forum ID seems to be missing
$threadidid = '{vb:raw threadid}';
PHP Code:
$sessionurl = $session['sessionurl']; $forumid = $foruminfo['forumid']; $post_phrase = 'Refresh this Listing'; $new_thread_link = '<div><a href="refresh.php?'.$sessionurl.'do=newthread&f='.$forumid.'" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top" style="margin-left:10px;"><span>+</span> '.$post_phrase.'</a></div>';
$find = '<div id="pagination_top"'; $replace = $new_thread_link.$find; $vbulletin->templatecache['SHOWTHREAD'] = str_replace($find, $replace, $vbulletin->templatecache['SHOWTHREAD']);
|
forumid was just in the sample code, I am using another product as a starting point, the threadid var is not working here.
this is what I have, no other plugin: (parse templates)
PHP Code:
if (THIS_SCRIPT == 'showthread'){
$sessionurl = $session['sessionurl'];
$threadidid = '{vb:raw threadid}';
$post_phrase = 'Refresh this Listing';
$refresh_link = '<div><a href="refresh.php?'.$sessionurl.'do=something&t='.$threadidid.'" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top" style="margin-left:10px;"><span>+</span> '.$post_phrase.'</a></div>';
$find = '<div id="pagination_top"';
$replace = $refresh_link.$find;
$vbulletin->templatecache['SHOWTHREAD'] = str_replace($find, $replace, $vbulletin->templatecache['SHOWTHREAD']);
in the template the button produces "
refresh.php?do=something&t={vb:raw%20threadid}"
I have also tried:
Code:
<plugin active="1" executionorder="5">
<title>new postbit button</title>
<hookname>cache_templates</hookname>
<phpcode><![CDATA[if (THIS_SCRIPT === showthread)
{
$cache[] = 'my_template';
}]]></phpcode>
</plugin>
<plugin active="1" executionorder="5">
<title>new postbit button</title>
<hookname>postbit_display_complete</hookname>
<phpcode><![CDATA[if ($this->post[postid] == $this->thread[firstpostid]){
$display_refresh_image = '';
$templater = vB_Template::create('my_template');
$templater->register('post', $post);
$templater->register('display_refresh_image', $display_refresh_image);
$template_hook['postbit_controls'] .= $templater->render();
}
]]></phpcode>
</plugin>
with the thread id vars in "my_template" but it only spits out the code, not the threadid.