View Full Version : Slightly complicated question...
krela
05-10-2005, 06:16 AM
Hi there,
Okay, my VB site uses CMPS, basically split into regions, so the default cpms page is nation, and then I have one CMPS pages for each region.
I also have a compulsory user profile option where users can select which corresponding region they are in.
What I want to do is make it so that the 'home' links on the vb pages will take them to their regional CMPS page rather than the default national page.
I guess in the header I need to query the db to find out their region and then set the link accordingly.
Any clues as to how and where I need to make changes to do this? Or if it can be done in a more efficient way?
Many thanks for any help,
Ben.
Misuzu
05-10-2005, 11:41 AM
maybe if u set up the custom field with vb, u can call it into the cmps page. maybe u have to globalize it somewhere. not sure.
krela
05-10-2005, 11:45 AM
Yeah globalising it was my first thought, as far as I'm aware those particular user profile fields aren't globalised though.
Anyone know how I might be able to do that, it would make the rest of the solution a whole lot easier than messing around with extra database calls or cookies.
KW802
05-10-2005, 11:53 AM
Krela, what exactly is the difference between each of the pages? If the only difference is one or two modules you can just cheat and create different usergroups for each of your regions then create a single master page with all of the different modules for all of the regions.... after that it's just a matter of setting the module permissions so that only people in the corresponding usergroup can see it/them.
krela
05-10-2005, 12:23 PM
I dont think that would work because although all the modules are the same across pages, each page uses different forums/calendar/gallery/linkdb IDs etc.
I also don't want to block people from seeing all the other pages, I just want them to be able to set one of them as their default homepage.
Brian
05-10-2005, 12:35 PM
Their region is set as a custom profile field, right? If so then you should be able to just link to something like this:
/index.php?$session[sessionurl]page=fieldX
(Replace 'fieldX' there with the appropriate field)
krela
05-10-2005, 02:03 PM
Their region is set as a custom profile field, right? If so then you should be able to just link to something like this:
/index.php?$session[sessionurl]page=fieldX
(Replace 'fieldX' there with the appropriate field)
It doesn't seem to be a global variable though, it returns blank if done like that.
Brian
05-10-2005, 02:07 PM
Sorry about that... Try $bbuserinfo[fieldx] (and again, replace x with the fieldid).
krela
05-10-2005, 02:49 PM
Yeah I noticed that myself, and it works!
Excellent thank you VERY much, for some reason I just assumed they wouldnt br global variables. :)
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.