How to detect if vbgallery is installed in ACP
Michael or Chuck.. or anyone else..
I am just writing a facebook style toolbar for my vb, it should also integrate some gallery functions..
but i ran into a problem.
How can I detect if vbgallery is installed when i am in ACP... or on non gallery pages...
I am surfing in blogs or on some forum-pages. I will only have the gallery icons appear if vbgallery is installed.. as I am not in vbgallery i cannot use: THIS_SCRIPT :(
Until I found an automatic solution, i have a manual setting in ACP:
I am using vBgallery: YES / NO
I would though like to automate this..
Is there a way.. in the options section of vbulletin, to check if vbgallery is installed?
Thx for any hint
Well for forums and other pages I found a way:
well you should be able to define the admin the same way it all looks for the same option stuff
Thx for your reply, chuck..
But i want to keep it easy.. so what i am doing now... is:
A. for non ACP pages..( public pages) i check if ppg_options is there..
if($ppg_options && is_array($ppg_options))
and for acp i just add an option that says: If you have vbgallery installed then show special gallery options to users.... YES / NO
I was going to hide that option in acp if vbgallery is not installed...
but now, well, its only a dummy option if vbgallery is not installed...
(BTw: its going to be a facebook style tool bar.. on all pages.. with a modal window that handles lots of features with ajax) .. I'll set up a demo as soon as I got something to show...)
Got ya well $ppg_options is valid in the control panel as well is what I was saying. ;)
YES!!!!!!!! works.. tested in admin_global hook)
i had an error in my plugin...
but.. (just thinking) for performance, shouldnt it be better to not add those settings on non vbgallery pages? I mean not to include them? so that pages having nothing to do with vbgallery.. (all pages where no images are shown) would not even get near ppg_options or something else..
well if your not including them on non vb pages then you need to figure out other ways to figure out if vbgallery is there. remember we use option arrays and define statements to figure out where we are. The easiest way for you to really do something that says vbgallery is installed is add a global_start plugin where you can define vbgallery installed .
there i do the check for ppg_options.
it seems to work !
Well it does not even need to be that complicated. If your vbulletin options array is available on all pages your plugin just needs to be
either I lost you there.. OR we are talking about the same thing ( with different words...:p)
My actual plugin is:
i check if is_array, because i ran into errors..(many many versions ago) where there were problems with $ppg_options not being an array...
(so if that kind of bug appears again.. i'm on the safe side)
We are talking kinda the same thing I was merely saying you really did not have to go checking arrays etc etc. You are the admin you know vbgallery is installed. You would add that line to your site I posted and then could simply use if clauses in php format or template format to add whatever your trying.
Ohhhh ok-- now i understand...
Yes, you are right. i could do it without checking..
But if for example.. i post the product as hack here,
and a user installs it.., it works..
then for some reason he uninstalls vbgallery... because (for example he switches to photopost pro), he would still get links to vbgallery files and send his users to 404 pages.. thats why i want to do the check..
what does ACP stand for?
ACP = Admin Control Panel (when you click the Admin link in the footer)
opposed to UCP = User Control Panel ( here its the top left link in the navbar called User CP)
|All times are GMT -5. The time now is 07:42 PM.|
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0