The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
||||
|
||||
[SOLVED]Pulling threadid in templates
This is a first time my doing this with vb4 and I need some help. This seems easy but I'm struggling with it bad.
I have added a sample product showing the 2 ways I am trying to add buttons within a post. thanks to shka I have the custom template one working, the parse_template one is not fetching the threadid though. I have tried pulling the threadid from postbit, and showthread within plugins. examplearse templat (in a showthread condition) i am just using new thread button in posts as a base, I want to add a button that will be grabbing the threadid not the forum id. Code:
$sessionurl = $session['sessionurl']; $threadidid = '{vb:raw threadid}'; $post_phrase = 'Refresh this Listing'; $new_thread_link = '<div><a href="refresh.php?'.$sessionurl.'do=newthread&f='.$threadid.'" 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']); but I am not having any luck. I first wanted to do this in postbit, but was having the same issue. Using post thanks button placement as my base, I could not get the threadid to input: Code:
<template name="post_thanks_button" templatetype="template" date="1477136504" username="Abe1" version="7.88"><![CDATA[ <vb:if condition="$post['userid'] != 0"> <a href="postings.php?t={vb:raw threadid}" class="post_thanks_button">Refresh</a> </vb:if>]]></template> Code:
<plugin active="1" executionorder="5"> <title>Post Thank You Hack</title> <hookname>postbit_display_complete</hookname> <phpcode><![CDATA[if ($this->post[postid] == $this->thread[firstpostid]){ $display_thanks_image = ''; $templater = vB_Template::create('post_thanks_button'); $templater->register('post', $post); $templater->register('display_thanks_image', $display_thanks_image); $template_hook['postbit_controls'] .= $templater->render(); } ]]></phpcode> </plugin> |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|