PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |
Old December 10th, 2004, 11:28 AM   #1 (permalink)
Registered User
Verified Customer
 
KW802's Avatar
 
Join Date: Nov 2005
Posts: 1,400
Any quick way of getting $privcatids value externally?

I give up!
Code:
Content visible to verified customers only.
I'm hitting my wall of PHP knowledge on this one.
Code:
Content visible to verified customers only.
I'm doing a query in a external php module but how would I go about getting the results of what would normally be in $privcatids so that I can exclude the forums that the user wouldn't have permissions to? I've tried following the logic of index.php and I can follow the logic of the functions it's using in functions_gallery.php but it seems that no matter what I try $categorycache isn't set properly (I get an error when it tries to loop through $categorycache in fetch_category_perms).

Any insight is appreciated.

Thanks,
Kevin
KW802 is offline   Reply With Quote
Old December 10th, 2004, 12:06 PM   #2 (permalink)
Brian
Guest
 
Posts: n/a
Re: Any quick way of getting $privcatids value externally?

So this is a totally external script and not using vBulletin at all?
It looks like your problem (as you said) is that you're not getting the categorycache. If it's completely external then you'll need to query the 'gallery_c_cache' from your datastore table (or if it is connected to vBulletin you can just add 'gallery_c_cache' to the $specialtemplates array before the call to global.php). Then you'll just need to unserialize the data with something like this:
$categorycache = unserialize($datastore['gallery_c_cache']);
  Reply With Quote
Old December 10th, 2004, 12:41 PM   #3 (permalink)
Registered User
Verified Customer
 
KW802's Avatar
 
Join Date: Nov 2005
Posts: 1,400
Re: Any quick way of getting $privcatids value externally?

Quote:
Originally Posted by Brian
So this is a totally external script and not using vBulletin at all?
Sort of. I'm trying to do a quickie 'random image' module for CMPS doing the least amount of queries as possible (which is always the goal ) but I'm stumbling on the permissions.

Quote:
Originally Posted by Brian
It looks like your problem (as you said) is that you're not getting the categorycache. If it's completely external then you'll need to query the 'gallery_c_cache' from your datastore table (or if it is connected to vBulletin you can just add 'gallery_c_cache' to the $specialtemplates array before the call to global.php). Then you'll just need to unserialize the data with something like this:
$categorycache = unserialize($datastore['gallery_c_cache']);
Off to more experimenting. Thanks.
KW802 is offline   Reply With Quote
Old December 10th, 2004, 12:45 PM   #4 (permalink)
Brian
Guest
 
Posts: n/a
Re: Any quick way of getting $privcatids value externally?

Ahh... If it's for the CMPS then just add 'gallery_c_cache' to the $specialtemplates array in your global.php file (in the stuff that you added for the CMPS at the top). Then you should be able to just require the functions_gallery.php file in your module's file and use the fetch_private_categories() function, which will return a nice comma separated list of private categories for you.
  Reply With Quote
Old December 10th, 2004, 01:47 PM   #5 (permalink)
Registered User
Verified Customer
 
KW802's Avatar
 
Join Date: Nov 2005
Posts: 1,400
Re: Any quick way of getting $privcatids value externally?

Quote:
Originally Posted by Brian
Ahh... If it's for the CMPS then just add 'gallery_c_cache' to the $specialtemplates array in your global.php file (in the stuff that you added for the CMPS at the top). Then you should be able to just require the functions_gallery.php file in your module's file and use the fetch_private_categories() function, which will return a nice comma separated list of private categories for you.
I think the little light bulb isn't coming on for me today.

Quote:
Warning: array_keys(): The first argument should be an array in /home/www/farpointstation/forums/includes/functions_gallery.php on line 269

Warning: Invalid argument supplied for foreach() in /home/www/farpointstation/forums/includes/functions_gallery.php on line 269
My {forums}/global.php file:
Code:
Content visible to verified customers only.
.... and the top of my query:
Code:
Content visible to verified customers only.
Any thoughts?
KW802 is offline   Reply With Quote
Old December 10th, 2004, 01:49 PM   #6 (permalink)
Brian
Guest
 
Posts: n/a
Re: Any quick way of getting $privcatids value externally?

Sorry, I forgot to mention in that post that you'll still need to unserialize the info pulled from your datastore table.

$categorycache = unserialize($datastore['gallery_c_cache']);
  Reply With Quote
Old December 10th, 2004, 04:00 PM   #7 (permalink)
Registered User
Verified Customer
 
KW802's Avatar
 
Join Date: Nov 2005
Posts: 1,400
Re: Any quick way of getting $privcatids value externally?

Quote:
Originally Posted by Brian
Sorry, I forgot to mention in that post that you'll still need to unserialize the info pulled from your datastore table.

$categorycache = unserialize($datastore['gallery_c_cache']);
I'm almost there.....

http://www.coolscifi.com/index.php?page=testing

Just have to figure out why some of the phrases aren't showing.
KW802 is offline   Reply With Quote
Old December 10th, 2004, 04:07 PM   #8 (permalink)
Brian
Guest
 
Posts: n/a
Re: Any quick way of getting $privcatids value externally?

You either need to add 'adv_gallery' to your $phrasegroups array, or change those phrases in your template and hardcode them.
  Reply With Quote
Old December 10th, 2004, 04:15 PM   #9 (permalink)
Registered User
Verified Customer
 
KW802's Avatar
 
Join Date: Nov 2005
Posts: 1,400
Re: Any quick way of getting $privcatids value externally?

Quote:
Originally Posted by Brian
You either need to add 'adv_gallery' to your $phrasegroups array, or change those phrases in your template and hardcode them.
I don't like hard-coding so in the array it goes.

... and it works. <does the Happy Happy, Joy Joy dance>

I'll write it up before I go home to let the usual crew tear it apart. Looks like one file change, one template change, one new module, and one new template.
KW802 is offline   Reply With Quote
Reply


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

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick reply weirdpixels How Do I? - vBulletin 3.0.X 2 February 27th, 2005 10:50 AM
Quick question DoKOK Before You Buy 4 February 16th, 2005 11:37 PM
few quick questions lasto Before You Buy 1 December 18th, 2004 05:10 PM


All times are GMT -5. The time now is 10:38 AM.

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