![]() |
Using vBulletin Cookies Outside the Fourms
I want to use the login cookie method for security outside of my forums area. What do I need to have in my files to make this happen? I am running in 100% php so this should be a pretty simple one for you guru's.
Here are the details: The forums are located in a directory below the main site: "http://www.site.com/users/forums" I want a login prompt at "http://www.site.com" and then proceed to "/users" once they have logged in using the vubulletin user db. |
I dont thing so. Unless you set up a multi domain cookie but it could be very un-secure.
|
It is all ONE domain.
http://www.site.com "/users" and "/users/forums" are all directories below "site.com" |
Quote:
If you need to secure your non-vb pages according to vb user/usergroup info, give WebTemplates hack a shot. |
WOW man, nice work, but its a lot more than I need. Do you have a stripped down script to do this? I don't need to be able to edit the pages and that from the forums, just the login prompt if they haven't logged in already.
|
I dont have a "light" version but I think it's not necessary either. I know the hack seems complicated but in fact it is not. After installation, all you have to do is to click ADD WEBTEMPLATE button, give it a name and copy/paste your non-vb page's source code inside it. Then put [cantsee]0 1 3[/cantsee] tag inside your webtemplate and you are done.
Now only your registered members (who also verified his email) can see your webtemplate, if he is not a member or he is a logged off member, webtemplate will automatically display him the login/register screen. So it is really very easy to use.. |
hmm, do you have a working example of this somewhere I can see, I don't quite understand how the template is incorporated into my php files. I have 3 files per page, one is the header inculude, the other is the footer include and then the contents. so would the pages become dynamic?
|
You tell me what do you have in your PHP file (content) and I'll tell you if you can convert it to a webtemplate.
Webtemplate hack comes with 2 default webtemplates "header" and "footer". You can customize them as you like then you add $header and $footer variables into your other webtemplates to include headers and footers to them. As for the content page: If it is a static HTML page, all you have to do is to copy/paste its source code and now it becomes a webtemplate. Of course it's address changes: you now call it as yourboardurl/show.php?pg=yourtemplatename If it's a dynamic PHP page which makes queries to MYSQL and get/post results on the fly, you can convert most of your queries to "webqueries" and insert into your webtemplates. For example if you have a query to list last 10 registered users of your board in your PHP file, you create a webquery named "_last10users", form the SELECT code and then insert "$_last10users" variable in any place in your webtemplate and while it's parsed it will retrieve data from MYSQL and automatically list the last 10 users. But if your PHP does more than that (eg. gets/list 10 item from db, then puts a link to get 10 more) you may not do it with the hack. There are some screenshots in the hack thread. If you want more, tell me what screenshot you exactly want. |
All the content is plain html, nothing fancy, I would like to get more in there as far as dynamics (how many people on the board, hot threads and last thread, newest member....etc) but that will come later, but I am thinking this will do it all, I am just a little warry about how it will work out, I don't have time to be a php programmer, but enough time to make it work the first time, its a tuff mulit-hat job I have.
|
so a page url would look like "site.com/index.php?pagename"
|
If it is plain HTML, it is VERY EASY to convert it to a webtemplate as I mentioned above. Just copy/paste its source code to a new webtemplate in your Admin CP and add the [cantsee] tag I mentioned above, you are done.
Now call it as http://www.yoursite.com/yourboard/sh...f_yourtemplate and here it is: If the visitor is a guest/unlogged member he will get please login/register to view this page message and if he is a logged-in user he will display your page. Very simple.. |
so in the "mysite.com/index.php" file it would simply have the include like this? "show.php?pagename"
This is going to make nested php files? I am using windows2k and IIS, so I am stuck in CGI-ville...what's that gonna do to my perfomance? |
I would also REALLY like to see this working somewhere...I want to get a feel for it.
|
Quote:
To load it, call it from your browser address bar as "url/board/show.php?pg=templatename" Quote:
http://www.turkhukuksitesi.com/hukuk...g=testtemplate However you cant feel it, because it's meaningless if you are a guest. You would feel it if you visited that template with different vb usernames to see dynamic content. Screenshots in the hack thread demonstrate it better. But you insisted so here you are.. And here is another template which is open to only Site Admin usergroup. Test it to see how hack forbids you from displaying the page if you dont have the permission: http://www.turkhukuksitesi.com/hukuk...p?pg=whoareyou My 2 cents: Hack is not a pain to install. It will take you less than 15 minutes to install so give it a try and if it doesnt work, uninstall and forget it. You'll have the best feeling by trying it.. As for performance issues, hack thread has lots of information.. |
just a quick question, this may sound dumb, but I wanna have my bases covered...in your instructions, you seperate things with "CUT" does this just signify the end of the instruction and the start of the code or does it mean to find that and cut it out of the file and then replace w/ your code? there needs to be some claification there for sure...
|
ok, I think I got everything in right, I left the code that you said to find, in....but when I got to run the "webtemplates_install.php" nothing happens...it just goes to this URL w/ the same page conents as the first page....
/forums/webtemplates_install.php?p=1 I click the link and it loads the same page w/ the same URL...I looked in code and I know its not supposed to look like that, obviously :) |
here is what I have in the webtemplates_install.php
$servername='localhost'; ## Username and password to log onto your MYSQL database server ## Remember: this username and password will be used when connecting to MYSQL database. $dbusername='root'; //MYSQL username $dbpassword=''; //MYSQL password ## Name of the MYSQL database where your vbdata is. $dbname='vbulletin'; |
thorin you need to edit this info to point your server/MYSQL username/password/databasename before running the script
and the CUT only points the begining and ending points, you dont need to delete the part unless it's obviously asked like "REPLACE it" |
Those are my correct settings, notice that the 'pass' is gone from the pasword string value?
|
can you give me the URL to webtemplates_install.php (you can pm), let me see it..
|
All times are GMT. The time now is 07:45 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|