The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Lil help? trying to change my code edit to a plugin
Hi, I need help getting my hack to work via a plugin instead of the hard coded edit I'm using now. I'm adding a THIS_SCRIPT criteria to the advertising manager. That way I can stick an ad in the 'Below Navbar' location but only have it appear in say forumdisplay or better yet, set the forum ID & limit it to forumdisplay. that way in a particular forum I can have different ads in the threads than on the forumdisplay listing.
I suppose I could have just added a template conditional to my ad code but I need to learn how to make vb4 plugins anyway & this seemed like it would be something I could handle. I was wrong. FYI: when I say my hack, to be fair I blatantly stole the NJAquaman - Notices THIS_SCRIPT Criteria mod & just changed it to work for Adverting instead of notices. All of the control panel stuff NJAquaman did in his mod works for this one w/ just minor edits. it's when I get to hook 'ad_check_criteria' that I couldn't get it to work which means the ad displays regardless of the THIS_SCRIPT setting. attached is a snippet of functions_ad.php and I've highlighted my added bit of code. this snippet of code makes the hack work & since it's directly above hook 'ad_check_criteria' my brain tells me I should be able to enter that same code into a plugin and call it at hook location 'ad_check_criteria' & I should be good to go. sadly it does not work. I guess I'm rustier than I thought. anyone have any idea what I'm doing wrong? thanks in advance |
#2
|
||||
|
||||
PS - I know there's an s missing from the criteria 'thiscript' but the var is called that throughout. it's now NJAquaman had it in his hack & I saw no need to change it. it's not that. like I said it works when hard coded.
|
#3
|
||||
|
||||
That code means nothing (what is $criteria['condition1']?) since we are unfamiliar with the code at all.
|
#4
|
||||
|
||||
sorry Lynne, it's part of vb4.11 function_ad.php the code above my highlighted code is the original code that i'm mimicking and my code works as is. it's when i move it to the plugin that is called at the hook directly below my highlighted code that it stops working. i was thinking my question was less about the code & more about plugin restrictions or maybe something special I need to do when using a plugin like registering variables or something.
i'm gonna keep plugging away at it after work. I didn't want to post a big pile of code but if you need to see more to put it into context, here's the rest. PHP Code:
|
#5
|
||||
|
||||
If you are changing hook locations, make sure you find the hook in the php code and see if the variable names have changed. Also, see if it's in a function because you may have to globalize a variable for use.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|