Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-03-2009, 01:14 PM
doa24uk doa24uk is offline
 
Join Date: Feb 2008
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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);
My question is, where should I put this code??

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
Reply With Quote
  #2  
Old 08-03-2009, 01:28 PM
EnIgMa1234 EnIgMa1234 is offline
 
Join Date: Mar 2006
Location: .:: Ireland ::.
Posts: 1,306
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried including it in a plugin using one of the showthread hooks?
Reply With Quote
  #3  
Old 08-03-2009, 01:39 PM
doa24uk doa24uk is offline
 
Join Date: Feb 2008
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ummm ......... please explain how I'd do this? Haven't really got my head round vbulletin structure yet....

ps. Thanks for the quick reply
Reply With Quote
  #4  
Old 08-03-2009, 02:27 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
$this->post['message2'] = base64_encode($this->post['message']); 
Reply With Quote
  #5  
Old 08-03-2009, 04:06 PM
doa24uk doa24uk is offline
 
Join Date: Feb 2008
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)??
Reply With Quote
  #6  
Old 08-03-2009, 04:29 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This will help you more - Adding or Editing a Plugin Try following that to create a plugin.
Reply With Quote
  #7  
Old 08-03-2009, 06:36 PM
doa24uk doa24uk is offline
 
Join Date: Feb 2008
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've created a new plugin

Product - vs hide Hack Resurrection
Hook Location - postbit_display_complete
Code -

Code:
$this->post['message2'] = "test-text";
echo $message2;
----

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??
Reply With Quote
  #8  
Old 08-03-2009, 10:20 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you don't want to echo anything. Remove the echo and then put $message2 in your postbit.
Reply With Quote
  #9  
Old 08-04-2009, 09:19 AM
doa24uk doa24uk is offline
 
Join Date: Feb 2008
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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]
& at some point it is parsed into the entire post...

Code:
The full topic post is then held in the topic variable

[HIDE]this content here[/HIDE]

See, like this
So I need a way to intercept it before it gets parsed as such..

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}">
    <table cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="alt2" style="border:1px inset">
			<div>$caption:</div>
			<div style="font-style:italic">
				<if condition="$canview">
					$message
				<else />
					$vbphrase[hidetag_accessdenied]
				</if>
			
			</div>
		</td>
	</tr>
	</table>
</div>]]></template>
And here's what is currently in the postbit_display_complete

Code:
$post['message'] = $GLOBALS['hhr']->parse_bbcode($post['message'], $forum['forumid'], $thread['threadid'], $post['postid'], $post['userid']);
Reply With Quote
  #10  
Old 08-04-2009, 03:20 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:28 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.15961 seconds
  • Memory Usage 2,272KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete