The Arcive of vBulletin Modifications Site. |
|
Pop-up window for registered users only (and vice versa) Details »»
|
|||||||||||||||||||||||||||
|
Pop-up window for registered users only (and vice versa)
Developer Last Online: Dec 2008
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! Show Your Support
|
|||||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
Just put the above code in index.php right after require_once( './global.php' );
Should do the trick |
|
#3
|
||||
|
||||
|
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! |
|
#4
|
||||
|
||||
|
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. |
|
#5
|
||||
|
||||
|
Thanks Insanctus!
I am going to try it! |
|
#6
|
||||
|
||||
|
Let me know if it works for you
|
|
#7
|
||||
|
||||
|
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! |
|
#8
|
||||
|
||||
|
did you add $headpop to your forumdisplay template ?
|
![]() |
|
|