PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  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
XtraX
Hangin' Around


Joined: Nov 03, 2004
Posts: 43

PostPosted: Wed Nov 03, 2004 2:52 pm Reply with quote Back to top

Hello Raven great site by the way..

I'm looking for information on cache lite and just how do l install it and where can l get it,

We have Nuke 7.2 installed and are looking to increase its speed and load times.

So any other tips to speed up the site would also be appreciated as well.

Our site has a total of 50 to 90 members online at all times and 150 visitors and we have noticed a drastic slow down on page loading sence the amoutn of traffic has encreased.


Any help you could provide would be highley appreciated.

Thanks XtraX Smile
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Nov 03, 2004 3:13 pm Reply with quote Back to top

Thanks.
Only registered users can see links on this board!
Get registered or login to the forums!
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
XtraX
Hangin' Around


Joined: Nov 03, 2004
Posts: 43

PostPosted: Wed Nov 03, 2004 5:37 pm Reply with quote Back to top

Thanks Raven for your help and the link to how l will start this now any pointers you may have before l get started besides backing up lol..

XtraX
View user's profile Send private message
XtraX
Hangin' Around


Joined: Nov 03, 2004
Posts: 43

PostPosted: Wed Nov 03, 2004 5:46 pm Reply with quote Back to top

Quick question it says to extract it into the includes folder ? do l leave Cache Lite in the folder it created when extracting it and upload it that way into the includes folder or do l upload the contents of Cache_lite into includes so just the files them selves
View user's profile Send private message
XtraX
Hangin' Around


Joined: Nov 03, 2004
Posts: 43

PostPosted: Wed Nov 03, 2004 5:48 pm Reply with quote Back to top

Never mind duuhh thats why they use the include line sorry for them dum question
View user's profile Send private message
XtraX
Hangin' Around


Joined: Nov 03, 2004
Posts: 43

PostPosted: Wed Nov 03, 2004 9:24 pm Reply with quote Back to top

Ok l need a little help l e-mailed chatserv as well, Its been awhile sence l did any udates to my heavily modified Nuke 7.2 and l was wondering where l can get the list of files and updates to make to my nuke 7.2 ..?

So l can secure it from SQL injections as l will have to manully update each file so l dont loose any changes made..

XtraX
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Wed Nov 03, 2004 9:51 pm Reply with quote Back to top

All of Chat's updates are available on my front page.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
XtraX
Hangin' Around


Joined: Nov 03, 2004
Posts: 43

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

But all l need is the code to replace there the actual files and l cant over write them or l will loose my previouse work

Ps the Cache_Lite rocks my site is 7 times faster thanks for your help it was so easy to install

XtraX Very Happy
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Thu Nov 04, 2004 12:31 am Reply with quote Back to top

Wait until I release the Cache Lite control panel I'm writing Smile
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
sharlein
Member Emeritus


Joined: Nov 19, 2002
Posts: 322
Location: On the Road

PostPosted: Thu Nov 04, 2004 12:13 pm Reply with quote Back to top

I think the directions are easy to follow. I tried to do 4 blocks and had zero successes. The last one (block survey) finally gave me something - an error code:
Code:
Fatal error: Call to undefined function: voteresults() in /home/xxxx/html/blocks/block-Survey.php on line 69
Any thoughts to put me back on track?
View user's profile Send private message
XtraX
Hangin' Around


Joined: Nov 03, 2004
Posts: 43

PostPosted: Thu Nov 04, 2004 12:58 pm Reply with quote Back to top

Post your code here and l will help you what code did you include in your blocks ?
and make sure to include the full path to the tmp file and make sure you created a Cache_Lite folder inside the tmp file and set permissions on it to 775 so it has read and write access..

XtraX
View user's profile Send private message
sharlein
Member Emeritus


Joined: Nov 19, 2002
Posts: 322
Location: On the Road

PostPosted: Thu Nov 04, 2004 3:05 pm Reply with quote Back to top

Code:
<?php

if (eregi("block-ScrollingSentinel.php",$_SERVER['PHP_SELF'])) {
    Header("Location: ../index.php");
    die();
}
// include the Cache-Lite package
require_once("includes/Cache_Lite/Lite.php");
// set some variables
$options = array(
  "cacheDir" => "/tmp/Cache_Lite/",
  "lifeTime" => 900
);
// create a Cache_Lite object
$objCache = new Cache_Lite($options);
// test if there exists a valid cache,
// the ID will be the basename of the block
$fileid = basename($blockfile,".php");
if ($content = $objCache->get($fileid)) {
// add a message indicating this is cached output
  $content .= "\n[cached with ID=$fileid]";
}
else
{
// do the block's work here...

global $prefix, $db, $user, $admin, $ab_config;
$usemarquee = 1;
$scrolldirection = "Down";
$content = "";
$content .= "<table border=1><tr><td ALIGN=\"center\" VALIGN=\"top\"> This is the list of Sentinel banned IP addresses. </td></tr></table><hr>\n";
$content .= "<Marquee Behavior=\"Scroll\" Direction=\"$scrolldirection\" Height=\"150\" ScrollAmount=\"1\" ScrollDelay=\"75\" onMouseOver=\"this.stop()\" onMouseOut=\"this.start()\"><br>";
$result = $db->sql_query("SELECT ip_addr, reason FROM $prefix"._nsnst_blocked_ips." ORDER BY date DESC LIMIT 30");
while (list($ip_addr, $ip_reason) = $db->sql_fetchrow($result)) {
  if((is_admin($admin) AND $ab_config['display_link']==1) OR ((is_user($user) OR is_admin($admin)) AND $ab_config['display_link']==2) OR $ab_config['display_link']==3) {
    $lookupip = str_replace("*", "0", $ip_addr);
    $content .= "<b><big>&middot;</big></b>&nbsp;<a href=\"".$ab_config['lookup_link']."$lookupip\" target=\"_blank\">$ip_addr</a>\n";
  } else {
    $content .= "<b><big>&middot;</big></b>&nbsp;$ip_addr\n";
  }
  if((is_admin($admin) AND $ab_config['display_reason']==1) OR ((is_user($user) OR is_admin($admin)) AND $ab_config['display_reason']==2) OR $ab_config['display_reason']==3) {
    $result2 = $db->sql_query("SELECT reason FROM $prefix"._nsnst_blockers." WHERE blocker='$ip_reason'");
    list($reason) = $db->sql_fetchrow($result2);
    $reason = str_replace("Abuse-","",$reason);
    $content .= "&nbsp;-&nbsp;$reason\n";
  }
  $content .= "<br />\n";
}
$content .= "</Marquee><br>";
$content .= "<hr><center><a href=\"http://www.nukescripts.net\" target=\"_blank\">"._AB_NUKESENTINEL." ".$ab_config['version_number']."</a></center>\n";
// ...and save it in the cache for future use
$objCache->save($content, $fileid);
}

?>


permissions=766
View user's profile Send private message
XtraX
Hangin' Around


Joined: Nov 03, 2004
Posts: 43

PostPosted: Thu Nov 04, 2004 6:02 pm Reply with quote Back to top

First you need to set the full path to your tmp/Cache_Lite file

Example: Mine is this!
Quote:
/home/virtual/site13/fst/var/tmp/Cache_Lite/


Mine is not located in the root folder for better security and this has to be done on every block second thing

Make sure the file is actually located in the path you specified

/tmp/Cache_Lite/

If your not sure what the direct path to the file is located on your server create a php file call it whatever you want example

123.php as you dont want others seeing this information and put this tag inside it

Code:
<?php phpinfo(); ?>


Then use your browser to directly go to the file
Only registered users can see links on this board!
Get registered or login to the forums!
site.com/123.php

that will give you the full path ..

Once you do get cache lite working it will also put an input line on the block itself viewable to you or anyone else letting you know it was cached ..

to remove this from the block comment out this line in the block file

// $content .= "\n[cached with ID=$fileid]";

Hope this helps

XtraX Smile
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Thu Nov 04, 2004 6:26 pm Reply with quote Back to top

Steve,

If you don't already have a tmp folder in your root nuke folder, create one. Then in the tmp folder create a folder called Cache_Lite. Now, when you specify
"cacheDir" => "tmp/Cache_Lite/" do NOT use a preceeding /. So, your top code in your block should look like this
Code:
require_once("includes/Cache_Lite/Lite.php");
// set some variables
$options = array(
  "cacheDir" => "tmp/Cache_Lite/",
  "lifeTime" => 3600
);
Note that I have moved my Lite.php file, but you should get the idea.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Nukeum66
Life Cycles Becoming CPU Cycles


Joined: Jul 30, 2003
Posts: 551
Location: Neurotic, State, USA

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

Hey Raven, I been using Cache Lite for a few weeks now. Caching blocks works great. My question is how would I use Cache Lite to cache whole pages? Would this be done in the same manner as a block?
View user's profile Send private message Visit poster's website
sharlein
Member Emeritus


Joined: Nov 19, 2002
Posts: 322
Location: On the Road

PostPosted: Fri Nov 05, 2004 2:28 pm Reply with quote Back to top

Here is the block code I am using:
Code:
<?php

/********************************************************/
/* Hacker Beware center block        (SQL Programing)   */
/* By: Stephen2417 (Orignal Code) &    xfsunolesphp     */
/* http://stephen2417.com          http://xfsunoles.com */
/* Copyright © 2004 by Stephen2417 & xfsunolesphp       */
/********************************************************/

if (eregi("block-Hacker_Beware2.php",$_SERVER['PHP_SELF'])) {
    Header("Location: ../index.php");
    die();
}
// include the Cache-Lite package
require_once("includes/Cache_Lite/Lite.php");
// set some variables
$options = array(
  "cacheDir" => "tmp/Cache_Lite/",
  "lifeTime" => 900
);
// create a Cache_Lite object
$objCache = new Cache_Lite($options);
// test if there exists a valid cache,
// the ID will be the basename of the block
$fileid = basename($blockfile,".php");
if ($content = $objCache->get($fileid)) {
// add a message indicating this is cached output
  $content .= "\n[cached with ID=$fileid]";
}
else
{
// do the block's work here...


global $db, $prefix, $ab_config;
$total_ips = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_nsnst_blocked_ips" ));
if(!$total_ips) { $total_ips = 0; }
$content  = "<center><img src=\"images/sentinel/Sentinel_Medium.png\" alt=\"You have been warned!\" title=\"You have been warned!\"><br />We have caught $total_ips shameful hackers.</center>";
$content .= "<hr><center><a href=\"http://www.nukescripts.net\">"._AB_NUKESENTINEL." ".$ab_config['version_number']."</a></center>\n";

// ...and save it in the cache for future use
  $objCache->save($content, $fileid);
}

?>

and here is the error I get:
Code:
Warning: main(includes/Cache_Lite/Lite.php): failed to open stream: No such file or directory in /home/xx/public_html/blocks/block-Hacker_Beware2.php on line 15

Fatal error: main(): Failed opening required 'includes/Cache_Lite/Lite.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xx/public_html/blocks/block-Hacker_Beware2.php on line 15

Quote:
Line 15 = require_once("includes/Cache_Lite/Lite.php");
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Fri Nov 05, 2004 4:10 pm Reply with quote Back to top

Steve,

Make sure that you have copied Lite.php from the Lite folder into the Cache_Lite folder.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Nukeum66
Life Cycles Becoming CPU Cycles


Joined: Jul 30, 2003
Posts: 551
Location: Neurotic, State, USA

PostPosted: Fri Nov 05, 2004 8:39 pm Reply with quote Back to top

Just for kicks try placing a copy of PEAR.php in your root directory.
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message Visit poster's website
sharlein
Member Emeritus


Joined: Nov 19, 2002
Posts: 322
Location: On the Road

PostPosted: Sat Nov 06, 2004 9:06 am Reply with quote Back to top

Sorry it took me so long to get back to you. I had PEAR.php in the root folder since I started. I even replaced it once to make sure it was corrupted. I think the problem lies in another direction entirely. Thanks, Steve
View user's profile Send private message
Nukeum66
Life Cycles Becoming CPU Cycles


Joined: Jul 30, 2003
Posts: 551
Location: Neurotic, State, USA

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

Have you tried playing with the permissions on that directory?
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

Raven wrote:
Steve,

Make sure that you have copied Lite.php from the Lite folder into the Cache_Lite folder.
Have you done this?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Rage
Insane


Joined: Jul 30, 2004
Posts: 85

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

Will there be any possibility of making this control panel work with CPG-Nuke Raven?
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

I know nothing of the internals of CGPNuke. I'm sure it is possible but I will have to look into it.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
sharlein
Member Emeritus


Joined: Nov 19, 2002
Posts: 322
Location: On the Road

PostPosted: Sat Nov 06, 2004 12:06 pm Reply with quote Back to top

Yes, Raven, I copied the Lite.php to the cache_lite folder and then placed it into includes.
View user's profile Send private message
dean
Worker
Worker


Joined: Apr 14, 2004
Posts: 193

PostPosted: Wed Jul 20, 2005 9:20 pm Reply with quote Back to top

So after all this, besides a speed difference is there a way I can tell its working? I dont see anything in the tmp directory except for the Cache_Lite directory and nothing is contained in it.
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum