Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 08 Feb 2011, 01:03
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
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
Attached Images
File Type: jpg Screenshot_4.jpg (70.3 KB, 10 views)
Reply With Quote
  #2  
Old 08 Feb 2011, 01:06
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
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.
Reply With Quote
  #3  
Old 08 Feb 2011, 02:39
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
That code means nothing (what is $criteria['condition1']?) since we are unfamiliar with the code at all.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #4  
Old 08 Feb 2011, 12:41
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
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.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Last edited by Mutt; 08 Feb 2011 at 12:46.
Reply With Quote
  #5  
Old 08 Feb 2011, 17:36
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
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.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 11:38.

Layout Options | Width: Wide Color: