vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Pop-up window for registered users only (and vice versa) (https://vborg.vbsupport.ru/showthread.php?t=57229)

Aaron1 09-19-2003 04:15 PM

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!

insanctus 09-19-2003 04:27 PM

Just put the above code in index.php right after require_once( './global.php' );

Should do the trick

Aaron1 09-19-2003 04:35 PM

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!

insanctus 09-19-2003 04:38 PM

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.

Aaron1 09-19-2003 06:36 PM

Thanks Insanctus!

I am going to try it!

insanctus 09-19-2003 06:45 PM

Let me know if it works for you :)

Aaron1 09-20-2003 12:46 PM

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!

insanctus 09-20-2003 09:48 PM

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
  • Page Generation 0.02134 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete