Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Blocks
Author Message
CodyG
Life Cycles Becoming CPU Cycles



Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island

PostPosted: Fri Nov 28, 2008 7:30 am Reply with quote

I use LastSeen. It is a block since phpnuke 5.1. Over time there were three authors, then it was edited by tom back in 6.0 days.

I've only had a problem since rn2.3. The block is working fine, except for an interesting cookie issue.
The script is creating new records with invalid usernames with unique ips. ??**!! Sad
The offending username is blank, or a user location field, ie: Victoria, Victoria, BC, etc. (Typical location values for my users.)
The table looks like this:

Code:
CREATE TABLE IF NOT EXISTS `nuke_lastseen` (

  `id` int(15) NOT NULL auto_increment,
  `username` text NOT NULL,
  `date` int(15) NOT NULL default '0',
  `ip` varchar(50) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=811 ;


And some code looks like this. What's wrong with this script bit???
Code:
global $cookie, $prefix, $currentlang, $db, $username, $numusers;

$prefix = "nuke";
$numusers = 10;

if(file_exists("language/lastseen/lastseen-$currentlang.php")) {
        include("language/lastseen/lastseen-$currentlang.php");
}
else {
        include("language/lastseen/lastseen-english.php");
}

        $username = $cookie[1];

if (isset($username)) {
                $ip = getenv("REMOTE_HOST");
                if (empty($ip)) {
                        $ip = getenv("REMOTE_ADDR");
                }

                $result = $db->sql_query("SELECT * FROM ".$prefix."_lastseen WHERE username = \"$username\"");
                if ($db->sql_numrows($result) > 0) {
                        $db->sql_query("UPDATE ".$prefix."_lastseen SET date = " . time() . " WHERE username = \"$username\"");
                } else {
                        $db->sql_query("INSERT INTO ".$prefix."_lastseen VALUES (\"\", \"$username\", ".time().", \"".$ip."\")");
                }
        }





Obviously, I've converted the $dbi-$db stuff. The script basically works, except for the cookie part, the blank username records.

Any ideas, fixes, suggestions, or thoughts?

_________________
"We want to see if life is ubiquitous." D.Goldin 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Fri Nov 28, 2008 8:03 am Reply with quote

Try this instead:

Code:


global $cookie, $prefix, $currentlang, $db, $username, $numusers;
$prefix = "nuke";
$numusers = 10;

if(file_exists("language/lastseen/lastseen-$currentlang.php")) {
        include("language/lastseen/lastseen-$currentlang.php");
}
else {
        include("language/lastseen/lastseen-english.php");
}

        $username = $cookie[1];

if (isset($username) && !empty($username)) {
                $ip = getenv("REMOTE_HOST");
                if (empty($ip)) {
                        $ip = getenv("REMOTE_ADDR");
                }
                if (!ereg('^([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$', $ip)) $ip = '';
                $username = addslashes($username);
                $result = $db->sql_query("SELECT * FROM ".$prefix."_lastseen WHERE username = '$username'");
                if ($db->sql_numrows($result) > 0) {
                        $db->sql_query("UPDATE ".$prefix."_lastseen SET date = " . time() . " WHERE username = '$username'");
                } else {
                        $db->sql_query("INSERT INTO ".$prefix."_lastseen VALUES ('', '$username', ".time().", '".$ip."')");
                }
        }



I think the anonymous user is creating your issue. Let us see if the !empty stops that, plus I made a few "security" related updates.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
CodyG







PostPosted: Fri Nov 28, 2008 9:28 am Reply with quote

Thanks Montego...
I made the changes to my production site and now will see how things go during the day. I'm sure it's going to work way better with the kaching!!empty thingy.

I'll have a look through the rest of the code and see if I can't apply something learned to the other bits. I'll be back. Thanks again.

Dance-Stick
 
CodyG







PostPosted: Fri Nov 28, 2008 5:56 pm Reply with quote

Well, empty username isn't back, but one username is showing up. ie: Victoria, which isn't a valid username but is a valid, and much used, location. So, I'm still confused. Wouldn't I also want to cross check for the username in nuke_users too?
 
montego







PostPosted: Sun Nov 30, 2008 9:27 am Reply with quote

You could add something like this to wrap around this (you would need to add $user and $userinfo to your globals:

getusrinfo($user);
if ((is_user($user)) AND (strtolower($userinfo['username']) == strtolower($cookie[1]))) {

put your other code here.

}
 
CodyG







PostPosted: Sun Nov 30, 2008 8:41 pm Reply with quote

I'm now getting There is no content for this block. Here is the entire script. Perhaps you can point to where I messed up? Perhaps putting the closing bracket below the last $content .=""; was a mistake?

Code:


<?

// Michael Yarbrough
// [ Only registered users can see links on this board! Get registered or login! ]
// http://www.comediccadavers.com/

// PHP-Nuke 5.1 Blocks version by Thiago Campos aka Mr. Hemp (mrhemp@amigoz.org)

// Updated to work with PHP-Nuke 6.0 and the phpBB2 forum port by
// Tom Nitzschner (tom@toms-home.com)
// http://bbtonuke.sourceforge.net (http://www.toms-home.com)
//
// As always, make a backup before messing with anything. All code
// release by me is considered sample code only. It may be fully
// functual, but you use it at your own risk, if you break it,
// you get to fix it too. No waranty is given or implied.
//
// Please change your prefix to suit your database.
// Set $numusers to the count of people you want listed +1
//
if ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
    die();
}
global $cookie, $prefix, $currentlang, $db, $username, $numusers, $users, $userinfo;
$prefix = "nuke";
$numusers = 10;

if(file_exists("language/lastseen/lastseen-$currentlang.php")) {
        include("language/lastseen/lastseen-$currentlang.php");
}
else {
        include("language/lastseen/lastseen-english.php");
}
       getusrinfo($user);
if ((is_user($user)) AND (strtolower($userinfo['username']) == strtolower($cookie[1]))) {

 $username = $cookie[1];

//        sql_query("CREATE TABLE IF NOT EXISTS ".$prefix."_lastseen (id INT (15) not null AUTO_INCREMENT, username TEXT not null, date INT(15) not null, ip CHAR(50), PRIMARY KEY (id), UNIQUE (id))", $dbi);

if (isset($username) && !empty($username)) {
                $ip = getenv("REMOTE_HOST");
                if (empty($ip)) {
                        $ip = getenv("REMOTE_ADDR");
                }
                if (!ereg('^([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$', $ip)) $ip = '';
                $username = addslashes($username);
                $result = $db->sql_query("SELECT * FROM ".$prefix."_lastseen WHERE username = '$username'");
                if ($db->sql_numrows($result) > 0) {
                        $db->sql_query("UPDATE ".$prefix."_lastseen SET date = " . time() . " WHERE username = '$username'");
                } else {
                        $db->sql_query("INSERT INTO ".$prefix."_lastseen VALUES ('', '$username', ".time().", '".$ip."')");
                }
        }

        $content = "";
        $result = $db->sql_query("SELECT username, date FROM ".$prefix."_lastseen ORDER BY date DESC limit $numusers");
        while (list($uname, $date) = $db->sql_fetchrow($result)) {
                if ($uname != $username) {
                        $realtime = time() - $date;
                        $dont = false;

                        // how many days ago?
                        if ($realtime >= (60*60*24*2)) { // if it's been more than 2 days
                                $days = floor($realtime / (60*60*24));
                                $dont = true;
                        } else if ($realtime >= (60*60*24)) { // if it's been less than 2 days
                                $days = 1;
                                $realtime -= (60*60*24);
                        }

                        if (!$dont) {
                                // how many hours ago?
                                if ($realtime >= (60*60)) {
                                        //$content .= " ($realtime) ";
                                        $hours = floor($realtime / (60*60));
                                        $realtime -= (60*60*$hours);
                                }

                                // how many minutes ago?
                                if ($realtime >= 60) {
                                        $mins = floor($realtime / 60);
                                        $realtime -= (60*$mins);
                                }

                                // just a little precation, although I don't *think* mins will ever be 60...
                                if ($mins == 60) {
                                        $mins = 0;
                                        $hours += 1;
                                }
                        }
                        $myresult = $db->sql_query("select user_id from nuke_users where (username='$uname')");
                            list($uid) = $db->sql_fetchrow($myresult);
                        $content .= "<font class=tiny><a href=\"profile-.html".$uid."\">".$uname."</a>:";
                        if ($dont) {
                                $content .= " ".$days." "._LASTSEENDAYS."";
                        } else {
                                if ($days > 0) {
                                        $content .= " ".$days." "._LASTSEENDAY."".(($hours == 0 && $mins == 0)?(""):(","));
                                }
                                if ($hours > 0) {
                                        $content .= " ".$hours." ".(($hours > 1)?(""._LASTSEENHOURS.""):(""._LASTSEENHOUR."")).(($mins == 0)?(""):(","));
                                }
                                if ($mins > 0) {
                                        $content .= " ".$mins." ".(($mins > 1)?(""._LASTSEENMINUTES.""):(""._LASTSEENMINUTE.""))."";
                                }  else { // less than a minute :)
                                        $content .= " ".$realtime." "._LASTSEENSECONDS."";
                                }
                        }

                        $content .= " "._LASTSEENAGO."</font><br />";

                        $days = 0;
                        $hours = 0;
                        $mins = 0;
                        $dont = false;
                }
        }
       // $content .= "";
        return $content;
        }



?>
 
montego







PostPosted: Mon Dec 01, 2008 6:23 am Reply with quote

CodyG, I have re-coded the block some as I believe the if statement wrapped too much of the code. Hopefully this will work better. I also forgot a couple of things and I needed to reformat the indentation in order to see the structure better... hopefully you do not mind:

Code:


<?
// Michael Yarbrough
// [ Only registered users can see links on this board! Get registered or login! ]
// http://www.comediccadavers.com/

// PHP-Nuke 5.1 Blocks version by Thiago Campos aka Mr. Hemp (mrhemp@amigoz.org)

// Updated to work with PHP-Nuke 6.0 and the phpBB2 forum port by
// Tom Nitzschner (tom@toms-home.com)
// http://bbtonuke.sourceforge.net (http://www.toms-home.com)
//
// As always, make a backup before messing with anything. All code
// release by me is considered sample code only. It may be fully
// functual, but you use it at your own risk, if you break it,
// you get to fix it too. No waranty is given or implied.
//
// Please change your prefix to suit your database.
// Set $numusers to the count of people you want listed +1
//
if ( !defined('BLOCK_FILE') ) {
   Header("Location: ../index.php");
   die();
}
global $cookie, $prefix, $currentlang, $db, $username, $numusers, $users, $userinfo;
$prefix = "nuke";
$numusers = 10;
$content = "";
if(file_exists("language/lastseen/lastseen-$currentlang.php")) {
      include("language/lastseen/lastseen-$currentlang.php");
}
else {
      include("language/lastseen/lastseen-english.php");
}
cookiedecode($user);
getusrinfo($user);
$username = $cookie[1];

if ((is_user($user)) AND (strtolower($userinfo['username']) == strtolower($cookie[1]))) {


//        sql_query("CREATE TABLE IF NOT EXISTS ".$prefix."_lastseen (id INT (15) not null AUTO_INCREMENT, username TEXT not null, date INT(15) not null, ip CHAR(50), PRIMARY KEY (id), UNIQUE (id))", $dbi);

   if (isset($username) && !empty($username)) {
      $ip = getenv("REMOTE_HOST");
      if (empty($ip)) {
         $ip = getenv("REMOTE_ADDR");
      }
      if (!ereg('^([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$', $ip)) $ip = '';
      $username2 = addslashes($username);
      $result = $db->sql_query("SELECT * FROM ".$prefix."_lastseen WHERE username = '$username2'");
      if ($db->sql_numrows($result) > 0) {
         $db->sql_query("UPDATE ".$prefix."_lastseen SET date = " . time() . " WHERE username = '$username2'");
      } else {
         $db->sql_query("INSERT INTO ".$prefix."_lastseen VALUES ('', '$username2', ".time().", '".$ip."')");
      }
   }
}

$result = $db->sql_query("SELECT username, date FROM ".$prefix."_lastseen ORDER BY date DESC limit $numusers");
while (list($uname, $date) = $db->sql_fetchrow($result)) {
   if ($uname != $username) {
      $days = 0;
      $hours = 0;
      $mins = 0;
      $dont = false;

      $realtime = time() - $date;

      // how many days ago?
      if ($realtime >= (60*60*24*2)) { // if it's been more than 2 days
         $days = floor($realtime / (60*60*24));
         $dont = true;
      } else if ($realtime >= (60*60*24)) { // if it's been less than 2 days
         $days = 1;
         $realtime -= (60*60*24);
      }

      if (!$dont) {
         // how many hours ago?
         if ($realtime >= (60*60)) {
            //$content .= " ($realtime) ";
            $hours = floor($realtime / (60*60));
            $realtime -= (60*60*$hours);
         }

         // how many minutes ago?
         if ($realtime >= 60) {
            $mins = floor($realtime / 60);
            $realtime -= (60*$mins);
         }

         // just a little precation, although I don't *think* mins will ever be 60...
         if ($mins == 60) {
            $mins = 0;
            $hours += 1;
            }
      }
      $myresult = $db->sql_query("select user_id from nuke_users where (username='$uname')");
      list($uid) = $db->sql_fetchrow($myresult);
      $content .= "<font class=tiny><a href=\"profile-.html".$uid."\">".$uname."</a>:";
      if ($dont) {
         $content .= " ".$days." "._LASTSEENDAYS."";
      } else {
         if ($days > 0) {
            $content .= " ".$days." "._LASTSEENDAY."".(($hours == 0 && $mins == 0)?(""):(","));
         }
         if ($hours > 0) {
            $content .= " ".$hours." ".(($hours > 1)?(""._LASTSEENHOURS.""):(""._LASTSEENHOUR."")).(($mins == 0)?(""):(","));
         }
         if ($mins > 0) {
            $content .= " ".$mins." ".(($mins > 1)?(""._LASTSEENMINUTES.""):(""._LASTSEENMINUTE.""))."";
         }  else { // less than a minute :)
            $content .= " ".$realtime." "._LASTSEENSECONDS."";
         }
      }

      $content .= " "._LASTSEENAGO."</font><br />";
   }
   return $content;
}

?>
 
CodyG







PostPosted: Mon Dec 01, 2008 6:52 am Reply with quote

Thanks Montego!! You rock my block! :clap:
 
CodyG







PostPosted: Mon Dec 01, 2008 7:19 am Reply with quote

Except ... $numusers is only outputting only 1 record and not the 10 asked for in $numusers.
And is: <a href=\"profile-.html".$uid."\">".$uname."</a>:"; something new in RN? a short link perhaps? It's throwing a Sorry, this Module isn't active.

And the _lastseen table doesn't appear to be updating. Has this something to do with $username2 and the table is username?
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Mon Dec 01, 2008 8:01 am Reply with quote

<a href=\"profile-.html".$uid."\">".$uname."</a>

You need to set that to what ever it was before. The shortlinks on this site are messing up the code when it is posted.


As for why you are only getting one person to show I have no idea. The above code looks good to me. other than "$prefix = "nuke";" should not be there.
 
View user's profile Send private message
Palbin







PostPosted: Mon Dec 01, 2008 8:13 am Reply with quote

Is there more than one person in the database table?
 
CodyG







PostPosted: Mon Dec 01, 2008 8:17 am Reply with quote

Yes, there are almost 732 records in the db table. $numusers is suppose to show the last 10. It's early here, 6:15am local and most users are local. But for the few users who have been online since I changed the code their _lastseen table records are not being updated at all.
 
CodyG







PostPosted: Mon Dec 01, 2008 9:34 am Reply with quote

I've checked rnlogs and error logs but find no errors.

That profile link makes sense, thanks for explaining. Perhaps that's what is messing up the db input? I'll fix it and see.
 
Palbin







PostPosted: Mon Dec 01, 2008 10:02 am Reply with quote

Code:


global $cookie, $prefix, $currentlang, $db, $username, $numusers, $users, $userinfo;


change to:
Code:


global $cookie, $prefix, $currentlang, $db, $username, $user, $userinfo;


And if you haven't remove this line: $prefix = "nuke";
 
CodyG







PostPosted: Mon Dec 01, 2008 10:31 am Reply with quote

I've made some changes, thanks for the clues! So, now we are updating the db again. Smile

Unfortunately, "There isn't content right now ..." has reappeared.




Code:


<?
/* Michael Yarbrough [ Only registered users can see links on this board! Get registered or login! ]
http://www.comediccadavers.com/

 PHP-Nuke 5.1 Blocks version by Thiago Campos aka Mr. Hemp (mrhemp@amigoz.org)

 Updated to work with PHP-Nuke 6.0 and the phpBB2 forum port by
 Tom Nitzschner (tom@toms-home.com)
 http://bbtonuke.sourceforge.net (http://www.toms-home.com)

 Updated by the RavenNuke Team.
As always, make a backup before messing with anything. All code
 release by me is considered sample code only. It may be fully
 functual, but you use it at your own risk, if you break it,
 you get to fix it too. No waranty is given or implied.
*/

// Set $numusers to the count of people you want listed +1

if ( !defined('BLOCK_FILE') ) {
   Header("Location: ../index.php");
   die();
}
global $cookie, $prefix, $currentlang, $db, $username, $user, $userinfo;

$numusers = 10;
$content = "";
if(file_exists("language/lastseen/lastseen-$currentlang.php")) {
      include("language/lastseen/lastseen-$currentlang.php");
}
else {
      include("language/lastseen/lastseen-english.php");
}
cookiedecode($user);
getusrinfo($user);
$username = $cookie[1];

if ((is_user($user)) AND (strtolower($userinfo['username']) == strtolower($cookie[1]))) {


//        sql_query("CREATE TABLE IF NOT EXISTS ".$prefix."_lastseen (id INT (15) not null AUTO_INCREMENT, username TEXT not null, date INT(15) not null, ip CHAR(50), PRIMARY KEY (id), UNIQUE (id))", $dbi);

   if (isset($username) && !empty($username)) {
      $ip = getenv("REMOTE_HOST");
      if (empty($ip)) {
         $ip = getenv("REMOTE_ADDR");
      }
      if (!ereg('^([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$', $ip)) $ip = '';
      $username2 = addslashes($username);
      $result = $db->sql_query("SELECT * FROM ".$prefix."_lastseen WHERE username = '$username2'");
      if ($db->sql_numrows($result) > 0) {
         $db->sql_query("UPDATE ".$prefix."_lastseen SET date = " . time() . " WHERE username = '$username2'");
      } else {
         $db->sql_query("INSERT INTO ".$prefix."_lastseen VALUES ('', '$username2', ".time().", '".$ip."')");
      }
   }
}

$result = $db->sql_query("SELECT username, date FROM ".$prefix."_lastseen ORDER BY date DESC limit $numusers");
while (list($uname, $date) = $db->sql_fetchrow($result)) {
   if ($uname != $username) {
      $days = 0;
      $hours = 0;
      $mins = 0;
      $dont = false;

      $realtime = time() - $date;

      // how many days ago?
      if ($realtime >= (60*60*24*2)) { // if it's been more than 2 days
         $days = floor($realtime / (60*60*24));
         $dont = true;
      } else if ($realtime >= (60*60*24)) { // if it's been less than 2 days
         $days = 1;
         $realtime -= (60*60*24);
      }

      if (!$dont) {
         // how many hours ago?
         if ($realtime >= (60*60)) {
            //$content .= " ($realtime) ";
            $hours = floor($realtime / (60*60));
            $realtime -= (60*60*$hours);
         }

         // how many minutes ago?
         if ($realtime >= 60) {
            $mins = floor($realtime / 60);
            $realtime -= (60*$mins);
         }

         // just a little precation, although I don't *think* mins will ever be 60...
         if ($mins == 60) {
            $mins = 0;
            $hours += 1;
            }
      }
      $myresult = $db->sql_query("select user_id from nuke_users where (username='$uname')");
      list($uid) = $db->sql_fetchrow($myresult);
      $content .= "<font class=tiny><a href=\"m_o_dules.pseehp?name=Forums&file=profile&mode=viewprofile&u=".$uid."\">".$uname."</a>:";
      if ($dont) {
         $content .= " ".$days." "._LASTSEENDAYS."";
      } else {
         if ($days > 0) {
            $content .= " ".$days." "._LASTSEENDAY."".(($hours == 0 && $mins == 0)?(""):(","));
         }
         if ($hours > 0) {
            $content .= " ".$hours." ".(($hours > 1)?(""._LASTSEENHOURS.""):(""._LASTSEENHOUR."")).(($mins == 0)?(""):(","));
         }
         if ($mins > 0) {
            $content .= " ".$mins." ".(($mins > 1)?(""._LASTSEENMINUTES.""):(""._LASTSEENMINUTE.""))."";
         }  else { // less than a minute :)
            $content .= " ".$realtime." "._LASTSEENSECONDS."";
         }
      }

      $content .= " "._LASTSEENAGO."</font><br />";
   }
   return $content;
}

?>
 
Palbin







PostPosted: Mon Dec 01, 2008 11:28 am Reply with quote

Interesting. So it is updating the DB, but not displaying anything.

The only reason there would be absoultly no content would be because of the 2 lines below. I don't see what is wrong with them at the moment and I am not home to test.

$result = $db->sql_query("SELECT username, date FROM ".$prefix."_lastseen ORDER BY date DESC limit $numusers");
while (list($uname, $date) = $db->sql_fetchrow($result)) {
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Mon Dec 01, 2008 4:31 pm Reply with quote

Wierd one!
Yes the global $users needs to be $user (no 's' on the end) as it is $user that is used.
Yes $prefix ="nuke" is not needed as you are using the global so you don't need to set it.

The sql statements create the tables and the INSERT is working.
The UPDATE appears to work also and the value $username2 is being set correctly (but there is only me online on the site I'm testing it on.
Hmm...

Edited UPDATE is working
 
View user's profile Send private message Send e-mail
Guardian2003







PostPosted: Mon Dec 01, 2008 4:57 pm Reply with quote

Midnight here so I'll have to come back to this one in the morning if no one else can.
 
CodyG







PostPosted: Mon Dec 01, 2008 5:13 pm Reply with quote

The changes are so far are keeping 'blank' users from the output. And, the number of invalid usernames has dropped dramatically. For example, in the past 24 hours: 0/100, instead of 1/20. I haven't been deleting in the db table all day! yeehaw!



I cobbled a Last_Seen module so I can lastseen 1000. That script is working fine, atm. Soon, I'll enhance it to include $user_email output. Then it will be a simple copy/paste to send updates to more than 364 days ago users.

But first things first... what's up with that darn block $content?
Need clarity: $prefix is only required in the global? $prefix='nuke'; is redundant?

Having finally figured out return $content in another script, I've become totally confuddled by the same statement in this script.

Another Question: Why the introduction of $username2 ??
 
Palbin







PostPosted: Mon Dec 01, 2008 5:34 pm Reply with quote

CodyG wrote:
Need clarity: $prefix is only required in the global? $prefix='nuke'; is redundant?

Yes, you only need the global because config.php is inlclued along the way which defines $prefix.

CodyG wrote:
Another Question: Why the introduction of $username2 ??
I am not 100% sure why Montego did that. Maybe he just wanted to keep $username in its standard form. It really does not matter. Since you said that I just noticed another little thing you can change. You can remove $username out of the globals.

Code:


global $cookie, $prefix, $currentlang, $db, $username, $user, $userinfo;


change to:
Code:


global $cookie, $prefix, $currentlang, $db, $user, $userinfo;


As for why no content, I am not sure yet. I haven't had time to play with it yet.
 
montego







PostPosted: Tue Dec 02, 2008 6:11 am Reply with quote

For use with the database calls, $username needed to have addslashes() to it, however, since $username is being used later on, one cannot just $username = addslashes($username). That is why I added $username2 = addslashes($username). I used $username2 everywhere it needed to be used. Sorry, but I didn't have time to create the table and test...

I just can't see why the content isn't showing either. Unfortunately, it will be some time before I can try and re-create this feature.
 
CodyG







PostPosted: Wed Dec 03, 2008 10:29 am Reply with quote

I became dazed and confused, then started over again with a copy from the backup dir. :/ Empty user and invalid usernames creeped back in within hours.
I went line by line making montego's changes. And, it's working for me for now. let's see what today brings.
Hurrah for return $content and all who shared. Dance-Stick
 
Guardian2003







PostPosted: Wed Dec 03, 2008 12:49 pm Reply with quote

Sorry I couldn't get back to this CodyG.
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Wed Dec 31, 2008 8:29 am Reply with quote

So has the block continued working well?
You were nice enough to share this block with me several months ago... Any chance of posting the edited code?
 
View user's profile Send private message Visit poster's website
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6433

PostPosted: Wed Dec 31, 2008 1:21 pm Reply with quote

I missed this before - why not use the new last visited field in RNYA (not the original one that was in standard Nuke that was only updated if a visitor visited the forums), at least for the members....

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Blocks

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©