![]() |
Define new variable for showthread.php
Hi guys,
I am wanting to define a new variable for use on showthread.php page ... The variable is based on a previously defined variable from Psionic Vision's Hide Hack Resurrection - here The variable $message is already defined & outputted on showthread.php I simply want to use $message to define a new variable like this Code:
$message2 = base64_encode($message); I have already asked on the support thread but Psionic has told me he doesn't support custom modifications ... cmon guys, it ain't that difficult! I should say that there is a super useful & important mod waiting to be released that relies on this new variable.... Many thanks in advance |
Have you tried including it in a plugin using one of the showthread hooks?
|
ummm ......... please explain how I'd do this? Haven't really got my head round vbulletin structure yet....
ps. Thanks for the quick reply :) |
You would create a plugin using a template_hook that takes $message and changes it how you want. I'm guessing that you would want to use one of hte postbit_ hooks (postbit_display_complete?)since $message is a postbit variable. So, you'd want something like:
PHP Code:
|
Aggghh I'm still lost. I've tried understanding it via this post but I still can't get my damn head around it!
Lynne, do you know of any users on here I could contact to format my code into a mod (paid or unpaid)?? |
This will help you more - Adding or Editing a Plugin Try following that to create a plugin.
|
I've created a new plugin
Product - vs hide Hack Resurrection Hook Location - postbit_display_complete Code - Code:
$this->post['message2'] = "test-text"; I've also tried without the echo - just $message2 & also tried echo'ing $message2 from postbit template ... Nothing so far ... what the heck am I doing wrong?? |
you don't want to echo anything. Remove the echo and then put $message2 in your postbit.
|
Hmm OK the test variables are working now, but I have a problem with teh original $message.
It seems like at some point the $message variable turns from being the text inside the HIDE tags Code:
[HIDE]this content here[/HIDE] Code:
Here's what's in the hide hack xml file (notice the $message variable - which does output the text I need correctly) Code:
<template name="bbcode_hposts" templatetype="template" date="1155999281" username="admin" version="2.7.0"><![CDATA[<div style="margin: 5px 20px 20px 20px;" id="<if condition="$canview">enb<else />dis</if>_hhr_hide::{$this->vars['postid']}_{$hidefieldid}"> Code:
$post['message'] = $GLOBALS['hhr']->parse_bbcode($post['message'], $forum['forumid'], $thread['threadid'], $post['postid'], $post['userid']); |
Once you 'post' a message, the entire text includes any bbcode tags that you have in there. They aren't stored separately. So, I'm not sure about what you mean about intercepting it between when it is just the bbcode and when it is the full message.
|
When creating a new topic or replying, a user can enter any text they wish between HIDE codes
Code:
[HIDE]Any text they wish[/HIDE] As far as I can tell, for me just to get "Any text they wish" I need to set the $message2 variable before it is parsed or combined into the "reformed" $message variable. Here's the php script from the Hide hack if that's any help.... (next post) |
1 Attachment(s)
Here's the php file for the hide hack if this helps .....
Again, thank you so much for your patience & persistence Lynne! You're a star! (looks for the paypal button) |
You realize that if you have post caching on, that the post is parsed when it is posted, not when it is displayed, right? So you need to 'intercept' the post when it is being posted, not displayed or else you won't be able to change what is hidden or not.
(I have no experience with hide hacks, so I'm really not the best person to help out with this.) |
Hi Lynne,
Ok so I've now been messing about with the newthread_post_start hook & it looks initially like this may be the area to be playing with (pre-caching) Anyway, the HIDE hack has the following code in misc_bbcode_complete & I've managed to create a variable & echo it then exit() when the post is submitted, so I think we may be getting closer ... could you take a look at the php code & see if any answers are hidden there ?? PHP Code:
|
All times are GMT. The time now is 03:28 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|