PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Tommyguns
Hangin' Around


Joined: Jul 07, 2004
Posts: 32

PostPosted: Wed Nov 10, 2004 4:39 pm Reply with quote Back to top

Great to see an update on YA!

When I log out and then log back in I get the following:

Cookie functions seem to be disabled.
Please change your browsersettings!

My Browser settings are at the lowest for cookies..

Also when I try to delete Cookies I get this:

The folowing cookies have been deleted:
Current Cookie Information:
Cookie Name: Cookie Status:
phpbb2mysql_data deleted
admin deleted
user deleted


Warning: session_destroy(): Trying to destroy uninitialized session in /home/gunssqu/public_html/modules/Your_Account/includes/cookiecheck.php on line 208

Any Suggestions?
View user's profile Send private message Visit poster's website MSN Messenger
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2363

PostPosted: Wed Nov 10, 2004 7:23 pm Reply with quote Back to top

But everything works ok once the page is refreshed?

I see the first event happening if I remove the test cookie then login without letting it refresh the page (set and read the test cookie).

I'll check with Richard he wrote the cookie check code. In the mean time try this and see if it makes any difference.
Find modules/Your_Account/includes/cookiecheck.php line 208
session_destroy();
and change it to
if(isset($_SESSION)){session_destroy();}

I'll look it over some more but this should get rid of the error your getting I think. That piece of code is noted as questionable in the file by Richard.
View user's profile Send private message
Tommyguns
Hangin' Around


Joined: Jul 07, 2004
Posts: 32

PostPosted: Wed Nov 10, 2004 8:49 pm Reply with quote Back to top

Thank you for the quick reply!

Yes everything works great once the page is refreshed..

OK I changed the line above and that cleared up the Warning: session_destroy.

After messing with it a bit I figured out that you need to use the User Info Block that is provided or go to YA to Login. That stops the page that comes up saying Cookie Fuctions seem to be disabled and brings you to YA. It seems to be calling something that others do not. What edits do we need to our theme and Site Info to make it work?

Thanks for the help!
View user's profile Send private message Visit poster's website MSN Messenger
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2363

PostPosted: Wed Nov 10, 2004 8:56 pm Reply with quote Back to top

In:
modules/Your_Account/includes/cookiecheck.php
Find:
$cookiedebug = "0";
Change it to:
$cookiedebug = "1";

This will show the cookies set to the user when they login but puts a continue button there and displays the proper message of "Your browser passed our cookie test without any problems!"

Thats the best I can come up with tonight I think its just a simple tweak needed to get the tests to run silently.

Another thing I would change in the same file is the protection line at the begining from:
if ( (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) AND (!eregi("admin.php", $_SERVER['SCRIPT_NAME'])) ) {
header("Location: ../../../index.php");
die ();
}
to:
if ( (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) ) {
header("Location: ../../../index.php");
die ();
}
View user's profile Send private message
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2363

PostPosted: Wed Nov 10, 2004 8:58 pm Reply with quote Back to top

Oh chitters no wonder I was getting that I was using my own block lol Ok thanks much!
View user's profile Send private message
Tommyguns
Hangin' Around


Joined: Jul 07, 2004
Posts: 32

PostPosted: Wed Nov 10, 2004 9:13 pm Reply with quote Back to top

That did it -- thanks!!
View user's profile Send private message Visit poster's website MSN Messenger
blith
Life Cycles Becoming CPU Cycles


Joined: Jul 18, 2003
Posts: 937

PostPosted: Wed Nov 10, 2004 9:21 pm Reply with quote Back to top

So is this a bug fix then for CNB? I want to do everything right when I install it.
View user's profile Send private message Visit poster's website
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2363

PostPosted: Wed Nov 10, 2004 9:47 pm Reply with quote Back to top

Yep here is a summary of the thread:
Find modules/Your_Account/includes/cookiecheck.php
Change:
if ( (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) AND (!eregi("admin.php", $_SERVER['SCRIPT_NAME'])) ) {
header("Location: ../../../index.php");
die ();
}
to:
if ( (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) ) {
header("Location: ../../../index.php");
die ();
}

Find modules/Your_Account/includes/cookiecheck.php line 208
session_destroy();
and change it to
if(isset($_SESSION)){session_destroy();}

And either edit your login block login function to use the same basic code as the one included OR use the one included OR:
In:
modules/Your_Account/includes/cookiecheck.php
Find:
$cookiedebug = "0";
Change it to:
$cookiedebug = "1";

OR just shut the cookie check off.
View user's profile Send private message
Tommyguns
Hangin' Around


Joined: Jul 07, 2004
Posts: 32

PostPosted: Wed Nov 10, 2004 10:10 pm Reply with quote Back to top

Quote:
OR just shut the cookie check off.


That would be no fun!
View user's profile Send private message Visit poster's website MSN Messenger
blith
Life Cycles Becoming CPU Cycles


Joined: Jul 18, 2003
Posts: 937

PostPosted: Wed Nov 10, 2004 11:08 pm Reply with quote Back to top

sixonetonoffun wrote:
.... ... ... ...
OR just shut the cookie check off.

ROTFL
View user's profile Send private message Visit poster's website
menelaos61
Worker
Worker


Joined: Nov 10, 2004
Posts: 110

PostPosted: Thu Nov 11, 2004 3:51 am Reply with quote Back to top

Hi Tommyguns,
My name is Richard, I send Andre Escudero (http://dev.phpnuke.org.br) my cookiecheck routines and I am glad he included it in this beta release.
Since this is a very new feature for CNBYA it is obvious that there are still some glithes in it. It is actually a great thing however to work together to improve it and make it a fully featured replacment for the 'normal' login-routines.

I totally forgot to think about login-blocks, and since the testcookie is being set just before you go to the main login screen, it is not set when using the Login-block.

Can you pm me the Login-block that you are using?

Probably a solution is to insert in block-Login.php:
Code:
include("modules/Your_Account/includes/cookiecheck.php");
yacookiecheck();


just before:
Code:
global $admin, $user, $sitekey, $gfx_chk;


This will set the testcookies, that will be checked for after login.

Also full page caching for anonymous users can prevent the testcookies being set. I'm thinking of solutions to work around this.

Cheers,
Richard
View user's profile Send private message Send e-mail
Tommyguns
Hangin' Around


Joined: Jul 07, 2004
Posts: 32

PostPosted: Thu Nov 11, 2004 6:43 am Reply with quote Back to top

It is the same Site Info Block as here:

Code:
<?php
/************************************************************/
/* Added $gfx_chk code to allow disabling as per v6.9 code. */
/* 21 October 2003  Gaylen Fraley                           */
/*                                                          */
/* Added 3 new hyperlink things :).  First off, if my block */
/* detects that you are using the Resend_Email module, it   */
/* will hyperlink the 'Waiting' text to the Resend_Email    */
/* block automatically.  Then, there is a new module        */
/* UserInfoAddons that the block will check for and if found*/
/* will hyperlink the New Today and New Yesterday text and  */
/* will display the new users from today and yesterday!     */
/* 30 Sept 2003 Gaylen Fraley                               */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* Corrected code that displays New Users Yesterday         */
/* 11 Nov 2004 Gaylen Fraley                                */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* Added Sam Spade lookup for registered users for Admins   */
/* only - 24 Sept 2003 Gaylen Fraley                        */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* Added 4 user settings - 20 Sept 2003 Gaylen Fraley       */
/* Added Hidden User Count - 20 Sept 2003 Gaylen Fraley     */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* Added user_avatar - 18 July 2003 Gaylen Fraley           */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* Update for PHP-Nuke 6.5 - 30 July 2003 Gaylen Fraley     */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* Update for PHP-Nuke 6.5 - 05 March 2003 Gaylen Fraley    */
/* website http://www.ravenphpscripts.com                   */
/*                                                          */
/* Updated for PHP-Nuke 5.6 -  18 Jun 2002 NukeScripts      */
/* website http://www.nukescripts.com                       */
/*                                                          */
/* Updated for PHP-Nuke 5.5 - 24/03/2002 Rugeri             */
/* website http://newsportal.homip.net                      */
/*                                                          */
/* (C) 2002                                                 */
/* All rights beyond the GPL are reserved                   */
/*                                                          */
/* Please give a link back to my site somewhere in your own */
/*                                                          */
/************************************************************/

/*********************************************************************************************************/
/* Setup - Use these settings to control how some of the user info block displays to users/admins.       */
/*********************************************************************************************************/
$showGuests              = FALSE; //Allow/notAllow displaying of guest ip's partial or otherwise.
$showGuestsAdmin         = TRUE;  //Allow/notAllow displaying of guest ip's partial or otherwise to Admins.
$showServerDateTime      = FALSE; //Allow/notAllow displaying of Server Date/Time.
$showServerDateTimeAdmin = FALSE; //Allow/notAllow displaying of Server Date/Time to Admins.
/*********************************************************************************************************/
/* You should not need to modify anything below this line                                                */
/*********************************************************************************************************/

if (eregi("block-Site_Info.php",$_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
}

function convertIP ($xip) {
   global $admin;
   if (is_admin($admin)) return $xip;
   $xipx = explode('.',$xip);
   for ($i=2;$i<count($xipx);$i++) {
      $xipx[$i] = preg_replace ('/(0|1|2|3|4|5|6|7|8|9)/', "x", $xipx[$i]);
   }
   return implode('.',$xipx);
}


$content = "";

mt_srand ((double)microtime()*1000000);
global $dbi, $nukeurl, $startdate, $user, $cookie, $prefix, $user_prefix, $db, $anonymous, $mode, $t, $f, $redirect, $random_num, $admin, $gfx_chk;
mt_srand ((double)microtime()*1000000);
$maxran = 1000000;
$random_num = mt_rand(0, $maxran);
$datekey = date("F j");
$rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
$code = substr($rcode, 2, 10);
cookiedecode($user);
$uname = $cookie[1];

$sql = "SELECT username,user_id FROM $user_prefix"._users." ORDER BY user_id DESC LIMIT 0,1";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);

$lastusername = $row[username];
$lastuser = $row[user_id];
$numrows = $db->sql_numrows($db->sql_query("SELECT user_id FROM $user_prefix"._users.""));
$numrows1 = $numrows-1;
$sql = "SELECT uname, host_addr FROM $prefix"._session." WHERE guest=0";
$result = $db->sql_query($sql);
$member_online_num = $db->sql_numrows($result);
$who_online_now = "";
$i = 1;
$hiddenTotal = 0;
while ($session = $db->sql_fetchrow($result)) {
    $sql = "select user_id, username, user_allow_viewonline from ".$user_prefix."_users where username='$session[uname]'";
    $member_result =  $db->sql_query($sql);
    if (sql_num_rows($member_result, $dbi) == 1) {
        $memberinfo = sql_fetch_array($member_result, $dbi);
    }
    if ($i < 10) $zi = "0$i";
    else $zi = $i;
    if (is_admin($admin)) {
      $sql1 = "SELECT host_addr FROM $prefix"._session." WHERE uname='$memberinfo[username]'";
      $result1 = $db->sql_query($sql1);
      mysql_fetch_row($result1);
      $zi = "<a href=\"http://www.samspade.org/t/lookat?a=".$session[host_addr]."\" target=\"_blank\">".$zi."</a>";
   }
    if (!$memberinfo[user_allow_viewonline]&&!is_admin($admin)) {
      $hiddenTotal++;
   }
    elseif (!$memberinfo[user_allow_viewonline]&&is_admin($admin)) {
      $hiddenTotal++;
      $who_online_now .= "$zi:&nbsp;<a href=\"userinfo-.html$session[uname]\"><img src=\"images/blocks/icon_mini_profile.gif\" border=\"0\" alt=\"Check the profile of $session[uname]\"></a>&nbsp;<a href=\"messages-.html$memberinfo[user_id]\"><img src=\"images/blocks/nopm.gif\" border=\"0\" alt=\"Send a quick private message to $session[uname]\"></a>&nbsp;<A HREF=\"profile-.html$memberinfo[user_id]\">$session[uname]</a>(H)<br />\n";
       $who_online_now .= ($i != $member_online_num ? "  " : "");
       $i++;
   }
    else {
      $who_online_now .= "$zi:&nbsp;<a href=\"userinfo-.html$session[uname]\"><img src=\"images/blocks/icon_mini_profile.gif\" border=\"0\" alt=\"Check the profile of $session[uname]\"></a>&nbsp;<a href=\"messages-.html$memberinfo[user_id]\"><img src=\"images/blocks/nopm.gif\" border=\"0\" alt=\"Send a quick private message to $session[uname]\"></a>&nbsp;<A HREF=\"profile-.html$memberinfo[user_id]\">$session[uname]</a><br />\n";
       $who_online_now .= ($i != $member_online_num ? "  " : "");
       $i++;
   }
}

//if (!is_admin($admin)) $i = $i - $hiddenTotal;
//if ($i<0) $i=0;
$sql = "SELECT uname, guest FROM $prefix"._session." WHERE guest=1";
$result = $db->sql_query($sql);
$gmember_online_num = $db->sql_numrows($result);
$gwho_online_now = "";
while ($session = $db->sql_fetchrow($result)) {
    if (isset($session["guest"]) and $session["guest"] == 1) {
       if ($i < 10) $zi = "0$i";
       else $zi = $i;
            $gwho_online_now .= "$zi:&nbsp;<a href=\"http://www.samspade.org/t/lookat?a=". convertIP($session[uname])."\" target=\"_blank\">". convertIP($session[uname])."</a><br />\n";
            $gwho_online_now .= ($i != $gmember_online_num ? "  " : "");
            $i++;
    }
}

$Today = getdate();
//Formatting Current Date
$month = $Today['month'];
$mday = $Today['mday'];
$year = $Today['year'];
//Formatting Previous Date
$pmonth = $Today['month'];
$pmday = $Today['mday'];
$pmday = $mday-1;
$pyear = $Today['year'];
//Month conversion into numeric mode
if ($pmonth=="January") { $pmonth=1; } else
if ($pmonth=="February") { $pmonth=2; } else
if ($pmonth=="March") { $pmonth=3; } else
if ($pmonth=="April") { $pmonth=4; } else
if ($pmonth=="May") { $pmonth=5; } else
if ($pmonth=="June") { $pmonth=6; } else
if ($pmonth=="July") { $pmonth=7; } else
if ($pmonth=="August") { $pmonth=8; } else
if ($pmonth=="September") { $pmonth=9; } else
if ($pmonth=="October") { $pmonth=10; } else
if ($pmonth=="November") { $pmonth=11; } else
if ($pmonth=="December") { $pmonth=12; };
$test = mktime (0,0,0,$pmonth,$pmday,$pyear,1);

//Creating SQL parameter
$test = mktime (0,0,0,$pmonth,$pmday,$pyear,1);
$curDate2 = "%".$month[0].$month[1].$month[2]."%".$mday."%".$year."%";
$preday = strftime ("%d",$test);
$premonth = strftime ("%B",$test);
$preyear = strftime ("%Y",$test);
$curDate3 = "%".$premonth[0].$premonth[1].$premonth[2]."%".$pmday."%".$preyear."%";

//Executing SQL Today
$sql = "SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDate2'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$userCount = $row[userCount];
//end

//Executing SQL Yesterday
$sql = "SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDate3'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$userCount2 = $row[userCount];
//end

$sql = "SELECT uname FROM ".$prefix."_session WHERE guest=1";
$result = $db->sql_query($sql);
$guest_online_num = $db->sql_numrows($result);
$sql = "SELECT uname FROM ".$prefix."_session WHERE guest=0";
$result = $db->sql_query($sql);
$member_online_num = $db->sql_numrows($result)-$hiddenTotal;
$who_online_num = $guest_online_num + $member_online_num + $hiddenTotal;

$sql = "SELECT username FROM ".$prefix."_users_temp";
$result = $db->sql_query($sql);
$waiting = $db->sql_numrows($result);

$content .= "<form action=\"modules.php?name=Your_Account\" method=\"post\">";

if (is_user($user)) {
   $sqlp = "SELECT user_posts AS posts FROM $user_prefix"._users." WHERE username = '$uname'";
   $result = $db->sql_query($sqlp);
   $row = $db->sql_fetchrow($result);
   $posts = $row[posts];
   $sql = "SELECT user_avatar FROM " . $prefix."_users WHERE username='$uname' AND user_avatar IS NOT NULL";
   $result = $db->sql_query($sql);
   if ($result) {
      $userinfo = $db->sql_fetchrow($result);
       if ( ereg( "(http)", $userinfo[user_avatar]) ) {
         $content .= "<br /><center><img src=\"$userinfo[user_avatar]\" /></center>\n";
       }
       else
       if ($userinfo[user_avatar]) {
         $content .= "<br /><center><img src=\"modules/Forums/images/avatars/$userinfo[user_avatar]\" /></center>\n";
       }
   }
   if ($posts>0) $content .= "<br /><center>$posts post(s)</center>\n";
    $content .= "<br /><img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$uname</b>.<br />\n\n";
    $content .= "<a href=\"modules.php?name=Your_Account&amp;op=logout\"><img src=\"images/blocks/arrow-blk.gif\" width=\"17\" border=0>&nbsp;Logout</a>\n<hr>\n";
    $sql = "SELECT user_id FROM $user_prefix"._users." WHERE username='$uname'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $uid = $row[user_id];
   $sql = "SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='5'";
   $result = $db->sql_query($sql);
   $een = $db->sql_numrows($result);
   $sql = "SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='1'";
   $result = $db->sql_query($sql);
   $twee = $db->sql_numrows($result);
   $newpms = $een + $twee;
   $sql = "SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'";
   $result = $db->sql_query($sql);
   $oldpms = $db->sql_numrows($result);
   $content .= "<img src=\"images/blocks/email-y.gif\" height=\"10\" width=\"14\"> <a href=\"modules.php?name=Private_Messages\"><b>"._BPM."</b></a><br />\n";
    $content .= "<img src=\"images/blocks/email-r.gif\" height=\"10\" width=\"14\"> "._BUNREAD.": <b>$newpms</b><br />\n";
    $content .= "<img src=\"images/blocks/email-g.gif\" height=\"10\" width=\"14\"> "._BREAD.": <b>$oldpms</b><br />\n<hr>\n";
} else {
    $content .= "<img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$anonymous</b>\n<hr>";
    $content .= "<table><tr><td>"._NICKNAME."</td><td><input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\"></td></tr>";
    $content .= "<tr><td>"._PASSWORD."</td><td><input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\"></td></tr></table>";
    if (extension_loaded("gd") AND ($gfx_chk == 2 OR $gfx_chk == 4 OR $gfx_chk == 5 OR $gfx_chk == 7)) {
       mt_srand ((double)microtime()*1000000);
       $maxran = 1000000;
      $random_num = mt_rand(0, $maxran);
      $content .=""._SECURITYCODE.": <img src='modules.php?name=Your_Account&op=gfx&random_num=$random_num' border='1' alt='"._SECURITYCODE."' title='"._SECURITYCODE."'>\n";
      $content .="<br />"._TYPESECCODE.": <input type=\"text\" NAME=\"gfx_check\" SIZE=\"11\" MAXLENGTH=\"10\"><br>\n";
      $content .="<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">\n";
    }
   $content .="<input type=\"hidden\" name=\"redirect\" value=$redirect>\n";
   $content .="<input type=\"hidden\" name=\"mode\" value=$mode>\n";
   $content .="<input type=\"hidden\" name=\"f\" value=$f>\n";
   $content .="<input type=\"hidden\" name=\"t\" value=$t>\n";
    $content .= "<input type=\"hidden\" name=\"op\" value=\"login\">";
    $content .= "<input type=\"submit\" value=\""._LOGIN."\">\n<br /><a href=\"modules.php?name=Your_Account&amp;op=new_user\">&middot;&nbsp;"._BREG."</a><br>";
    $content .= "<a href=\"modules.php?name=Your_Account&amp;op=pass_lost\">&middot;&nbsp;"._PASSWORDLOST."</a><hr>";
}
$content .= "<img src=\"images/blocks/group-2.gif\" height=\"14\" width=\"17\"> <b><u>"._BMEMP.":</u></b><br />\n";
$content .= "<img src=\"images/blocks/ur-moderator.gif\" height=\"14\" width=\"17\"> "._BLATEST.": <a href=\"userinfo-.html$lastusername\"><img src=\"images/blocks/icon_mini_profile.gif\" border=\"0\" alt=\"Check the profile of $lastusername\"></a>&nbsp;<A HREF=\"profile-.html$lastuser\"><b>$lastusername</b></a><br />\n";
if (is_admin($admin) AND @file_exists("modules/UserInfoAddons/index.php")) {
   $btdLink = "<a href=\"modules.php?name=UserInfoAddons&amp;timespan=today\">"._BTD."</a>";
   $bydLink = "<a href=\"modules.php?name=UserInfoAddons&amp;timespan=yest\">"._BYD."</a>";
}
else {
   $btdLink = _BTD;
   $bydLink = _BYD;
}
$content .= "<img src=\"images/blocks/ur-author.gif\" height=\"14\" width=\"17\"> ".$btdLink.": <b>$userCount</b><br />\n";
$content .= "<img src=\"images/blocks/ur-admin.gif\" height=\"14\" width=\"17\"> ".$bydLink.": <b>$userCount2</b><br />\n";
if (is_admin($admin) AND @file_exists("modules/Resend_Email/index.php")) $waitLink = "<a href=\"modules.php?name=Resend_Email\">".Waiting."</a>";
else $waitLink = Waiting;
$content .= "<img src=\"images/blocks/ur-member.gif\" height=\"14\" width=\"17\"> ".$waitLink.": <b>$waiting</b><br />\n";
$content .= "<img src=\"images/blocks/ur-guest.gif\" height=\"14\" width=\"17\"> "._BOVER.": <b>$numrows1</b><br />\n<hr>\n";
$content .= "<img src=\"images/blocks/group-3.gif\" height=\"14\" width=\"17\"> <b><u>"._BVISIT.":</u></b>\n<br />\n";
$content .= "<img src=\"images/blocks/ur-anony.gif\" height=\"14\" width=\"17\"> "._BVIS.": <b>$guest_online_num</b><br />\n";
$content .= "<img src=\"images/blocks/ur-member.gif\" height=\"14\" width=\"17\"> "._BMEM.": <b>$member_online_num</b><br />\n";
$content .= "<img src=\"images/blocks/ur-hiddenmember.gif\" height=\"14\" width=\"17\"> "."Hidden".": <b>$hiddenTotal</b><br />\n";
$content .= "<img src=\"images/blocks/ur-registered.gif\" height=\"14\" width=\"17\"> "._BTT.": <b>$who_online_num</b><br />\n<hr noshade>\n";
if ($member_online_num > 0) {
    $content .= "<img src=\"images/blocks/group-1.gif\" height=\"14\" width=\"17\" align=\"middle\"> <b><u>"._BON.":</u></b><br />$who_online_now";
    $hr = "\n<hr noshade>\n";
}
if ($gmember_online_num > 0 && ($showGuests||($showGuestsAdmin&&is_admin($admin)))) {
    $content .= "<br />$gwho_online_now";
    $hr = "\n<hr noshade>\n";
}
$content .= $hr;

/* Hits for Today */
$t_time = time();
$t_year = date("Y", $t_time);
$t_month = date("n", $t_time);
$t_date = date("j", $t_time);
$result = sql_query("SELECT hits FROM $prefix"._stats_date." WHERE year='$t_year' AND month='$t_month' AND date='$t_date'", $dbi);
list($today) = sql_fetch_row($result, $dbi);
/* Hits for Yesterday */
$y_time = $t_time - 86400;
$y_year = date("Y", $y_time);
$y_month = date("n", $y_time);
$y_date = date("j", $y_time);
$result = sql_query("SELECT hits FROM $prefix"._stats_date." WHERE year='$y_year' AND month='$y_month' AND date='$y_date'", $dbi);
list($yesterday) = sql_fetch_row($result, $dbi);
/* Hits in Total */
$totalhits = 0;
$result = sql_query("SELECT sum(hits) FROM $prefix"._stats_year."", $dbi);
list($totalhits) = sql_fetch_row($result, $dbi);
$content .= "<center><small>"._WERECEIVED."</small><br />\n";
$content .= "<b><a href=\"stats.html\">$totalhits</a></b><br />\n";
$content .= "<small>"._PAGESVIEWS."<br />$startdate</small></center>";
$content .= "<hr noshade>";
$content .= "<center>"._BHITS." "._BTD.": <b><a href=\"stats.html&op=DailyStats&year=$t_year&month=$t_month&date=$t_date\">$today</a></b><br />";
$content .= ""._BHITS." "._BYD.": <b><a href=\"stats.html&op=DailyStats&year=$y_year&month=$y_month&date=$y_date\">$yesterday</a></b><br /></center>";
if ($showServerDateTime || ($showServerDateTimeAdmin&&is_admin($admin))) {
   $content .= "<hr noshade>";
   $sdt = date("j F Y\nH:i:s T");
   $zone = date("Z")/3600;
   if ($zone >= 0) {
      $zone = "+".$zone;
   }
   $content .= "<center>"._SERDT."<br />$sdt (GMT $zone)</center>";
}
$content .= "</form>";

?>
View user's profile Send private message Visit poster's website MSN Messenger
Tommyguns
Hangin' Around


Joined: Jul 07, 2004
Posts: 32

PostPosted: Thu Nov 11, 2004 7:23 am Reply with quote Back to top

Hi Richard - nice meeting you...

I get the following:

Code:
Fatal error: Cannot redeclare yacookiecheck() (previously declared in /home/gunssqu/public_html/modules/Your_Account/includes/cookiecheck.php:25) in /home/gunssqu/public_html/modules/Your_Account/includes/cookiecheck.php on line 24


When I change added the above line like:

Code:
$content = "";

mt_srand ((double)microtime()*1000000);

I also changed this back [code]$cookiedebug = "0"; From $cookiedebug = "1"; [/code]


include("modules/Your_Account/includes/cookiecheck.php");
yacookiecheck();
global $dbi, $nukeurl, $startdate, $user, $cookie, $prefix, $user_prefix, $db, $anonymous, $mode, $t, $f, $redirect, $random_num, $admin, $gfx_chk;
mt_srand ((double)microtime()*1000000);
$maxran = 1000000;
$random_num = mt_rand(0, $maxran);


I also change the following line back:

From $cookiedebug = "0"; to $cookiedebug = "1";
View user's profile Send private message Visit poster's website MSN Messenger
blith
Life Cycles Becoming CPU Cycles


Joined: Jul 18, 2003
Posts: 937

PostPosted: Thu Nov 11, 2004 8:34 am Reply with quote Back to top

so what am I supposed to do? What is the right code to have where? I just installed it and now I feel like I am flappin' in the breeze... Wink
View user's profile Send private message Visit poster's website
Tommyguns
Hangin' Around


Joined: Jul 07, 2004
Posts: 32

PostPosted: Thu Nov 11, 2004 11:06 am Reply with quote Back to top

blith -- everything is fine with the Module - just the cookie thing needs some tweaks - just turn your Cookies off until you feel comfortable that we have come to a resolution..
View user's profile Send private message Visit poster's website MSN Messenger
blith
Life Cycles Becoming CPU Cycles


Joined: Jul 18, 2003
Posts: 937

PostPosted: Thu Nov 11, 2004 11:37 am Reply with quote Back to top

Thank you! I will continue to monitor until a official statement is put out.
View user's profile Send private message Visit poster's website
Cheff
New Member
New Member


Joined: Nov 11, 2004
Posts: 6

PostPosted: Thu Nov 11, 2004 1:54 pm Reply with quote Back to top

Cookie functions seem to be disabled.
Please change your browsersettings!
1: setcookie('CNB_test1','value1' FAILED!
2: setcookie('CNB_test2','value2',time()+120) FAILED!
3: setcookie('CNB_test3','value3',time()+120,'/') FAILED!
4: setcookie('CNB_test4','value4',time()+120,'') FAILED!




How i fix it?
View user's profile Send private message
Tommyguns
Hangin' Around


Joined: Jul 07, 2004
Posts: 32

PostPosted: Thu Nov 11, 2004 2:07 pm Reply with quote Back to top

Cheff wrote:
Cookie functions seem to be disabled.
Please change your browsersettings!
1: setcookie('CNB_test1','value1' FAILED!
2: setcookie('CNB_test2','value2',time()+120) FAILED!
3: setcookie('CNB_test3','value3',time()+120,'/') FAILED!
4: setcookie('CNB_test4','value4',time()+120,'') FAILED!




How i fix it?


Go to your Browser > Tools > Internet Options > Privacy... edit YOUR cookies there..
View user's profile Send private message Visit poster's website MSN Messenger
menelaos61
Worker
Worker


Joined: Nov 10, 2004
Posts: 110

PostPosted: Thu Nov 11, 2004 3:14 pm Reply with quote Back to top

Hey guys,
I think I figured out a solution. It will take some more time to evaluate if this is the best solution but it solves the described problems with the Login-block.

Forget what I said about adding lines to your loginblock, instead: remove them.

open modules/Your_Account/index.php
FIND (AND REMOVE):
Code:
        // cookiecheck by menelaos dot hetnet dot nl
        yacookiecheck();

open modules/Your_Account/includes/mainfileend.php
FIND
Code:
// CNB Mod
?>

BEFORE THIS LINE ADD:
Code:
else {
setcookie("CNB_test1","value1");
setcookie("CNB_test2","value2",time()+3600);
setcookie("CNB_test3","value3",time()+3600,"/");
setcookie("CNB_test4","value4",time()+3600,"$ya_config[cookiepath]");
}

The testcookies will now be set everytime a anonymous user visits
your website, and not only when they login through the main Your_Account login screen.

Please try this fix and let me know if it worked for you.

Cheers,
Richard

BTW. Are any of you guys use full-page caching for anonymous users?


Last edited by menelaos61 on Fri Nov 12, 2004 3:25 pm; edited 1 time in total
View user's profile Send private message Send e-mail