![]() |
Pop-up window for registered users only (and vice versa)
Is possible that whenever forumhome loads that a user will be checked if it's registered or not, and if that's the case, a pop-up window will appear with the content of my choice?
I already checked the database here for a similar hack, but the ones i found where done through a dhtml popup, but not the old fashion new window pop-up i want. Wait! I found some tips from Firefly in a thread: https://vborg.vbsupport.ru/showthread.php?t=27372 This is what he suggested: __________________________________________________ In global.php add if ($bbuserinfo['userid']==0) { eval("\$headexpressreg = \"".gettemplate('head_expressreg')."\";"); } right after $newpmmsg=1; eval("\$headnewpm = \"".gettemplate('head_newpm')."\";"); } now create a new template, head_newpm, and put this in it: <script language="javascript"><!-- window.open('http://www.yoursite.com/forum/file.php'); // --></script> __________________________________________________ __ This could be very close to what i want, but how do i make this happen in forumhome only? Because everytime global.php is accessed that pop-up will keep appearing. And that could be irritating... Cheers! |
Just put the above code in index.php right after require_once( './global.php' );
Should do the trick |
Ok cool, so when i want the popup to show for registered users only, i will need this code (modified) code below like this?
_____________________________________ if ($bbuserinfo['userid']==1) { eval("\$popupreg = \"".gettemplate('popup_reg')."\";"); } _____________________________________ $bbuserinfo['userid']==0 (not registered, guests) $bbuserinfo['userid']==1 (registered) That's correct? Cheers! |
if ($bbuserinfo['userid']>=1) {
eval("\$popupreg = \"".gettemplate('popup_reg')."\";"); } If you did if ($bbuserinfo['userid']==1) { eval("\$popupreg = \"".gettemplate('popup_reg')."\";"); } Then only user with user id of 1 would get pop up. |
Thanks Insanctus!
I am going to try it! |
Let me know if it works for you :)
|
Strange it doesn't work.
I added this piece of code in index.php right after: -------------------------------------------------------- require('./global.php'); if ($bbuserinfo['userid']>=1) { eval("\$headpop = \"".gettemplate('head_pop')."\";"); } -------------------------------------------------------- And I added a template called head_pop with this inside: -------------------------------------------------------- <script language="javascript"><!-- window.open('http://www.housequake.com/forum/test.html'); // --></script> -------------------------------------------------------- But nothing happens. Do you think i overlooked something? Cheers! |
did you add $headpop to your forumdisplay template ?
|
All times are GMT. The time now is 10:48 PM. |
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:
|