Yeah, I get that now with CNBYA every so often. I don't know why. (Haven't had the time to really dig.)
The Class
| Code: |
</filename>domain = $domain;
}
function newCache($file){
/* Get the history */
$handle = fopen($this->pathToCache . $this->historyFile, 'r');
$history = '';
while (!feof($handle)) {
$history .= fread($handle, 8192);
}
fclose($handle);
$pos = strpos($history, $file);
$historyArray = array();
$historyArray = explode('|', $history);
if ($pos === false){
// hasn't been cached before, make a cache
$handle = fopen($this->domain . $file, 'r');
$cache = '';
while (!feof($handle)) {
$cache .= fread($handle, 8192);
}
fclose($handle);
if ($handle = fopen($this->pathToCache . $file, 'w+')){
if (fwrite($handle, $cache)){
fclose($handle);
$historyArray[sizeof($historyArray)] = $file .','.time();
//update history
if ($handle = fopen($this->pathToCache . $this->historyFile, 'w+')){
$historyText = '';
foreach($historyArray as $v){
$historyText .= $v.'|';
}
$historyText = substr($historyText, 0, strlen($historyText) - 1);
if (fwrite($handle, $historyText)){
return true;
}else{
echo 'History could not be saved.';
return false;
}
}else{
echo 'History file missing!';
return false;
}
}else{
fclose($handle);
echo 'Data could not be written to cache!';
return false;
}
}else{
fclose($handle);
echo 'File could not be created.';
return false;
}
}else{
// it has been cached before. check if its up to date
foreach ($historyArray as $i => $v){
$pos = strpos($v, $file);
if ($pos === false){}
else{
$data = explode(',', $v);
$timeSinceCache = time() - $data[1];
if ($timeSinceCache > ($this->expiry * 60)){
//need a recache
$handle = fopen($this->domain . $file, 'r');
$cache = '';
while (!feof($handle)) {
$cache .= fread($handle, 8192);
}
fclose($handle);
if ($handle = fopen($this->pathToCache . $file, 'w+')){
if (fwrite($handle, $cache)){
$historyArray[$i] = $file .',' . time();
//update history
if ($handle = fopen($this->pathToCache . $this->historyFile, 'w+')){
$historyText = '';
foreach($historyArray as $v){
$historyText .= $v.'|';
}
$historyText = substr($historyText, 0, strlen($historyText) - 1);
if (fwrite($handle, $historyText)){
return true;
}else{
echo 'History could not be saved.';
return false;
}
}else{
echo 'History file missing!';
return false;
}
}else{
echo 'Data could not be written to cache!';
return false;
}
}else{
echo 'File could not be created.';
return false;
}
}else{
return true;
}
}
}
}
}
function printCache($file){
if (file_exists($this->pathToCache . $file)){
include($this->pathToCache . $file);
}else{
echo 'Cache not found.';
}
}
}
?> |
Usage
| Code: |
<?
// filename index.php
// instantiate the class
include('websiteCache.php');
$c = new websiteCache();
/**
This class will allow you to cache your websites, or, someone else's for quick viewing.
cacheInit($url);
newCache($fileName); //file name relative to the URL
printCache($fileName); //file name relative to the URL
Enjoy!
**/
$c->cacheInit('http://www.yourdomain.com');
if ($c->newCache('index.html')){
$c->printCache('index.html');
}
?> |
I have looked at some AJAX tools and also (briefly) the Yahoo API's so I'll certainly check out the jQuery UI.
There are a couple of things already on this site that isn't contain within a block (not in a block file) but still contained within the outer 'column' DIV (for want of a better description) but I'm keen to look at any methods that can be used to allow users to re-order content (as against expand/contract blocks) to suit their needs.
Thanks for letting me know about the jQuery UI as it is something I had not considered.
Spammers use forum scanning to find forums that are vulnerable to automated sign-up and posting.
If you are an administrator of a forum and want to prevent automated abuse for your board, then consider blocking the netblocks below.
10 89.28.14.104 (mail.cigoutlet.us, STARNET S.R.L, MV, 89.28.0.0/17)
10 84.19.180.90 (Keyweb AG, DE, 84.19.160.0/19 and 87.118.64.0/1
10 77.91.227.113 (WEBALTA, RU, 77.91.224.0/21)
10 77.244.209.198 (gw.fobosnet.ru, RZT Network, RU, 77.244.208.0/20)
10 72.232.162.34 (Layered Technologies, US)
6 87.118.116.100 (Keyweb AG)
6 195.210.167.45 (COMSTAR, RU, 195.210.128.0/1
5 147.202.28.25 (TEAM Technologies, US, 147.202.0.0/16)
4 87.118.118.173 (Keyweb AG)
4 85.255.115.146 (UkrTeleGroup, UA, 85.255.112.0/20)
2 89.178.154.161 (CORBINA-BROADBAND, RU, Dial-Up)
2 89.149.226.58 (netdirekt e.K., DE, 89.149.192.0/1
2 89.149.208.221 (netdirekt e.K.)
2 87.99.92.36 (Telenet, LV, Dial-Up)
2 87.236.29.207 (n207.cpms.ru, CPMS Network, RU, 87.236.24.0/21)
2 87.118.120.127 (Keyweb AG)
2 87.118.106.41 (Keyweb AG)
2 84.200.29.124 (Internet-Homing GmbH, DE, 84.200.29.0/24)
2 78.157.143.201 (VdHost Ltd, LV, 78.157.143.128/25)
2 76.120.171.54 (Comcast, US)
2 75.126.166.122 (Softlayer, US)
2 72.9.105.42 (Ezzi.net, US, 66.199.224.0/19, 72.9.96.0/20)
2 72.232.7.10 (Layered Technologies)
2 69.46.23.155 (Hivelocity Ventures Corporation, US, 69.46.0.0/19)
2 69.46.16.166 (Hivelocity Ventures Corporation)
2 69.126.44.157 (Optimum Online, Dial-Up)
2 60.21.161.73 (CNCGROUP Liaoning province network, CN)
2 220.130.142.189 (HINET, TW)
2 200.142.97.194 (Mundivox, BR)
2 195.2.114.31 (MICROLINK, LV)
1 61.235.150.228 (China Railway, CN)
1 60.209.21.101 (China Network, CN)
1 60.190.79.24 (something in China)
1 200.27.116.188 (Telmex Chile, CL)
So either you or your nephew expanded the field size to something other than "TINYINT"... ???
I used a modified one on my Uni project site. It uses a plain html form which is validated by a php file before being handed back to the original form for the mail send. I used this particular method so I could adapt the processing to exclude certain words or phrases in the event I started getting spam - the user still gets an 'your email has been sent' message as I quite like the idea of a spammer sitting their typing away and submitting the form not even knowing he is wasting his time lol.
I'll see if I can dig it out.
On the other hand, if you do not need a form with specific fields here's a good method...
Use one of the popular sites that offer email address obsfucation to create simple mailto: link and just put the link on your site. Set BoxTrapper on in cPanel for that address with an expiry of maybe two days and let it run. I have had very little spam using this technique and it's quick, simple and dirty.
If you do end up getting spam you can change the address.
The following is code extrapolated from Nuke EVO which might prove useful to those who need a second line of defense after htaccess
I have not tested this extrapolated code and it is intended only to be used by those who know what they are doing as I'm not supporting it or making any recommendations on it's use.
Create a new PHP file called iplock.php
Insert the following code and upload it to includes/iplock.php
Don't forget to ann a deny directive for this file in robots.txt
| Code: |
startphptag
if (realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME'])) {
exit('Access Denied');
}
global $ips, $users_ips;
// IPs that are used to allowed access to admin.php and forum admin; all others will be denied
// Seperate all IPs by a comma.
// ex: $ips = array('127.0.0.1', '192.168.1.1');
//$ips = array('xxx.xxx.xxx.xxx');
// IPs that are allowed to login to the specified user accounts
// Seperate all IPs by a comma inside the second ''.
// ex: $users_ips = array('Technocrat', '127.0.0.1,192.168.1.1');
//$users_ips = array('name', 'xxx.xxx.xxx.xxx');
endphptag
|
The main functions used
These functions should be accessible from mainfile.php or placed in another file included by mainfile.php (perhaps added to functions.php ??).
| Code: |
function user_ips() {
include_once(includes/iplock.php');
global $users_ips;
if(isset($users_ips)){
if(is_array($users_ips)){
for($i=0, $maxi=count($users_ips); $i < $maxi; $i += 2) {
$i2 = $i + 1;
$userips[strtolower($users_ips[$i])] = explode(',',$users_ips[$i2]);
}
return $userips;
}
}
return null;
}
// compare_ips function by Technocrat
function compare_ips($username) {
$userips = user_ips();
if(!is_array($userips)) {
return true;
}
if(isset($userips[strtolower($username)])) {
$ip_check = implode('|^',$userips[strtolower($username)]);
if (!preg_match("/^".$ip_check."/",identify::get_ip())) {
return false;
}
}
return true;
}
|
Example useage
To protect webroot/admin.php
After the initial normal admin auth check and mainfile has been included..
| Code: |
global $domain, $admin_file;
require_once'includes/iplock.php';
if(isset($ips) && is_array($ips)) {
$ip_check = implode('|^',$ips);
if (!preg_match("/^".$ip_check."/",identify::get_ip())) {
unset($aid);
unset($admin);
global $cookie;
$name = (isset($cookie[1]) && !empty($cookie[1])) ? $cookie[1] : _ANONYMOUS;
die('Invalid IP<br>Access denied');
}
define('ADMIN_IP_LOCK',true);
} |
Until I can get the time to right a full how-to, although it is simplicity itself I appreciate there are many just starting out with *nuke so you can grab images and code from here
http://www.exploding-boy.com/images/EBmenus/menus.html
By viewing the source code you can easily see which bits of html and CSS you need to copy.
If you are adding this to a nuke block, remember to use the $content variable - look at the sample block that *nuke provides.
If like me you want it to *fit* a little tighter you can place the HTML code sirectly into your theme.php file above the block() function.
I thank you for letting me know!
I have been meaning to change the download link in the header but got embroiled in some other work.
Just for clarification, the Digital Shop was written by
gotcha too and the theme I'm using here is identical to the one at nukecoder - I have just changed the colours

Sadly, I have not had the chance to make a start on this yet, life keeps getting in the way.
Thank you sir. I'll have to look into that. I am sure they must have communicated the change somehow. I will admit, I haven't reviewed my stats in a long time. If no time to do anything about them, why look at them... lol.
No need to apologise Sir! like most of us in this great community, we are split from here to the 12th of Never with a 'to do' list that expands by the square root of the number of items we cross off it
No problems, it can wait a while longer
Edited by me to correct stupid typo's - it was a long day and I was tired

As per a post on Ravens site. for those that want to 'play' but don't want to use images.
I think replacing the _READMORE language constant with $title would be a nice touch.
It certainly seems like it would be a better anchor link txt to use the news item title rather than 'readmore' but depending on the theme, the length of the title might throw the design out.
FREE SERVICE!!
We can convert any pdf document to flash (swf) format to allow you to more easily embed your documents into web pages.
If you need your pdf domentation converting but cannot afford to purchase the full versions of Acrobat 8.1 Pro and FlashPaper 2 then why not let us do the conversion for you for free.
i tired adding the new bbcode but it messed up so i have to go back to my back up forums. I am using PNC for our gaming site.
It isn't an 'error', that message is generated because your IP is listed as an open proxy in pre-existing blacklists.
I should add that this message does not mean you have been added to a blacklist, merely that your IP is ALREADY listed by one or more third party blacklists.
However, it is curious that if you have been using Spam Stopper for a few days or so and this is the first time 'you' have been blocked.
You may wish to review the blacklist file for words which might appear in your internal links as this would also cause this message.
It does indicate 'localkeywordblock' which normally means a blacklisted word was used in an internal url or referred url.
Do you have a gallery installed? - this is one of the blacklisted words.
Just for those that are interested in the functionality of modal boxes I have placed a text link to one on at the top of my front page under the Spam Stopper image.
The example I'm using is actually semi-modal as clicking the original page (under the box) will close the box, whereas a fully modal box actually completely disables the originating page until the 'Close' button is depressed on the modal box - I found I prefered the other method

No this is not a thread about the so called Web 2.0 style but as part of my University course I'm doing, it requires a knowledge and use of javascript.
I have been looking around at a variety of js and ajax scripts, the two most predominant ones are the jQuery and mooTools frameworks.
Both of these seem to offer Web 2 like capabilities for presentation of data.
I was particularly struck by the nice affect afforded by
moodalbox which is a class extender script for the mooTools ajax framework.
You can see a demo of this effect by clicking any of the page links on this sites tutorial module (links are only modified at the page link level not the categroy level) when I get it finished.
Basically, the data is opened in a modal window - the data frame opens on top of the existing page.
Unfortunately, most links internal to nuke also call a header, footer and usually blocks so I had to modify the function to remove the header, footer etc in the modal window. If you are creating a nice, neat little modal window just to display specific data, like a tutorial page, you don't really want all the encumbent crap that goes with it.
This had kinda got me to thinking just how wasteful nuke really is at times and of course, with a modal window, you have no worries about someone trying to copy/paste your tutorial or other content because it is simply impossible.
Edit: There is NO content theft protection - I was working on the fact that with a semi-modal window you cannot click inside it and 'copy' but you can still view source etc so if conten theft is what you are after, this is not the answer.
Thanks montego for pointing out what should have been obvious to me.
I have not figured out yet how to make the category list page 'modal' as once you are in 'modal' mode, so to speak, you have no header so therefore no call to the js file which is in the header.
I may play with it some more if time allows, this is just really something to do as a bit of relaxation from my coursework.
I have finished experimenting with my tag cloud so I'm happy to release further details now I know it works etc etc.
The scripts I downloaded from
http://johannburkard.de/blog/programming/javascript/dynacloud-a-dynamic-javascript-tag-keyword-cloud-with-jquery.html
Johann Burkards blog and found them extremely easy to integrate.
The beauty of this particular use of a tag cloud is it's flexibility. You can either edit your existing content and include it within a DIV tag to get the script to scan through that specific content for words to use in the tag cloud OR if you use the WordStats script with it, it will scan the whole page once it has loaded and then create a page wide tag cloud.
Getting the cloud itself to appear anywhere on your page is simplicity itself.
If anyone decides to incorporate this tag cloud within their site you can ask in this thread for assistance and I'll do whatever I can to help as it is a pretty straight forward script.
Note: This tag cloud was originally designed to produce a cloud of words and when a word is clicked, it highlights all other instances of that word on the page in yellow. If you want the simple modifications I did so that words within the cloud use the phpNuke Search module when clicked, I am more than happy to share that with anyone who is interested.
You just need to remove 'gallery' from the blacklist file and/or the 'bad words' table depending on which version of Spam Stopper you are using.