vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Day & Night look (https://vborg.vbsupport.ru/showthread.php?t=1741)

07-15-2000 02:16 AM

Thanks for all the feedback. maybe it is more trouble than it's worth but I thought it would be a nice touch to have a day vs a night look.

07-15-2000 05:44 PM

This can be done rather easily, except for the bbtitle and posting images. If you can live without those, you're good to go...

Actually, you _can_ do it with those images as well :)

Here's how.

Open up global.php (not in the admin dir), and look for:
Code:

// load vars
$vars=$DB_site->query("SELECT * FROM replacement ORDER BY replacementid DESC");

Replace with:
Code:

if (date("G") < 18 && date("G" > 6) {
// load vars
$vars=$DB_site->query("SELECT * FROM replacement ORDER BY replacementid DESC");
}

Look for:
Code:

  $DB_site->data_seek(0,$vars);
  while ($var=$DB_site->fetch_array($vars)) {
    $newtext=str_replace($var[findword],$var[replaceword],$newtext);
  }

Replace with:
Code:

if (date("G") < 18 && date("G" > 6) {
  $DB_site->data_seek(0,$vars);
  while ($var=$DB_site->fetch_array($vars)) {
    $newtext=str_replace($var[findword],$var[replaceword],$newtext);
  }
} else {
    $newtext=str_replace("<body>,"<body bgcolor=dark>",$newtext);
    $newtext=str_replace("<largefont,"<font color=dark",$newtext);
    $newtext=str_replace("</largefont>","</font>",$newtext);
etc...
}

The entire else statement should be a manual duplication of the normal dovars subroutine, so go look in your replacements table, and do what I started, except change the values and colors to what you want it to look like at night.

You can also add bbtitle.gif to the first variable in str_replace, and use the darktitle.gif name in the second variable. This will replace that image, and you can do the same for newpost, postreply, etc.

Ask if you have any questions.

Oh, and this was coded in my web browser, so there might be one or two stupid errors. :)

07-16-2000 02:00 PM

That seems a lot of clart on when you can just put replacement variables in the header!

08-11-2000 09:57 PM

"It is extremely complicated though unless you know every visitor to your site is in the same part of the world, to work properly you would have to get them to input their latitude and longditude and correct current timezone and have access to forumulas which will calculate sunrise and sunset times for everywhere around the world - not an easy task."

No, actually it would be possible to do something like visualtraceroute.datametrics.org on a couple of packets. Using that info it could customize it. It could also ask for the users time zone and customize it for each user.


All times are GMT. The time now is 07:44 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.01074 seconds
  • Memory Usage 1,723KB
  • 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
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete