PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   How Do I? - vBulletin 3.0.X (http://www.photopost.com/forum/how-do-i-vbulletin-3-0-x/)
-   -   Is there any reason not to add a define to php files? (http://www.photopost.com/forum/how-do-i-vbulletin-3-0-x/118678-there-any-reason-not-add-define-php-files.html)

SomeName July 5th, 2005 01:57 PM

Is there any reason not to add a define to php files?
 
6 Attachment(s)
Can anyone see any reason that adding
Code:

Content visible to verified customers only.
to my managecats.php (and another define in the upload.php) would cause any undesirable behavior? I went ahead and added it because I want more control over where/when my gallery button on the navbar displays and so far haven't seen any problem but I'm a novice so I thought I'd better ask.

Also, while we're here, my navbar gallery/forum button modification behaves differently than the ones posted in the cmps 1x forums and it's for Zach's vBulletin 3 classic style so I had to create a new button and edit a different template. Should I post it since there's already others even though mine behaves differently? Should I post the gif image that I made with it or should I not since it's Zach's style? If I should post it, where? In the cmps 1x forum, (it involves adding define statements to gallery php files)?

Im attaching screenshots of my navbar so you can see what Im talking about.

Brian July 5th, 2005 05:13 PM

Re: Is there any reason not to add a define to php files?
 
There shouldn't be any reason why adding the THIS_SCRIPT code would hurt anything. If you're just trying to determine if you're somewhere in the gallery though, you might want to try and if condition like this instead:

<if condition="VBA_SCRIPT == 'gallery'">

SomeName July 5th, 2005 05:32 PM

Re: Is there any reason not to add a define to php files?
 
Thanks for your response Brian. I tried your suggestion, but when I go to the gallery/upload.php or gallery/managecats.php or gallery/search.php,etc then it shows the gallery button. (and yes, I remembered to remove my define() before I tested it.) ;)

What I was doing was making the button show forum as long as you were anywhere associated with the gallery and gallery when you are on the home page or at any of the forum pages such as forum/search.php etc.

Does that make sense?

here's the code I wound up with that seemed to work everywhere the way I wanted it:
Code:

Content visible to verified customers only.
I only had to add define() in 2 files, I think to accomplish it.

Would it be ok for me to attach the button that I made or should I ask Zach or would nobody need/want it... :o


All times are GMT -5. The time now is 09:13 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97