Jump to content
xisto Community

wappy

Members
  • Content Count

    165
  • Joined

  • Last visited

Everything posted by wappy

  1. Does anyone know how to count used bandwidth and disk space using php?? An example would be much appreciated. Thanks in advance ;-)
  2. Hi ;-),i need some php code that will search any site or index page for a string. So i can check if my link is on sites it should be quickly?
  3. NeoCult: WAP SITE <--- is my site (you must visit it with OPERA or another WAP capable browser) it don't have much on it as its only three days old (lost old hosting) but it has on it from top to bottom.... A random advert leading to one of two toplists... My logo... A affiliate link to a custom pay download page with my logo and link back...A search box that searchs all the files on my site... The community (a wap chat script i created).. Php script folder, php snippet folder, artwork and icon folder, smileys folder... Online, file, day hits, and hits counters... Thats it ;-)...
  4. I build wap sites not web but same theory ok: add to your site a TOP LIST, guestbook/chat services (with links to your site on each book/room), register with two or three of the best top lists you can find, place a random ADVERT at top of your site showing one of this top list links each time... The list goes on an on.. Have a links sections and encourage others to also have links section and exchange many many links but only put inside another page or it will get messy. Try to make a service of anything you can code but think others may struggle with ;-) ps add your site to any free search engine submissions you can find ;-)
  5. LAUGHS out LOUD! He he.. Good job i have come.. All i build is wap sites... Ok DONT FORGET THE WML PART. The best coding for wap is a combination of php AND wml! As for forums... I have a few on the site in my sig... But its a WAP site so visit it with opera or another browser capable of viewing wap pages ok. Then into my search type: unreal (will bring up some wap forums created by a guy called unrealX edit by a fool called tommie, excuse the rude title of the zip but the guy is a pain so i put his site up for download) or hypetype (this will also bring up unrealX forums edit by a better coder) this script is like the one used on 2wap.net (gumslone) if unreal x contacts you and says you need license tell him to do one, its a load of rubbish, the script has no official copyright ;-)
  6. I think i like the sound of the myBB.. You see i create wap/mobile sites mainly not web sites. I use a mobile version of opera to browse the web alot (like now) and phpBB is nasty an slow for my device. This forum is ok. So im pretty sure i will go for myBB. I need it for more advanced members of my wap site to post snippets etc as doing this on wap or in wap chat/forums often causes many errors even after its been filtered. Thanks for the advice ;-)---I have tried it and its great! There are some mods including a shout box, download section, photo resize, and more i forget. I added shout box.
  7. Mmm... I have lost many accounts due to overuse of bandwith... I had an "UNLIMITED" (lol) account. Also my site was only a wap/mobile site. BUT i did have on it well over 5000 downloads, and was getting a few thousand hits a day. Also had file uploader running off the ftp commands, and a busy text file chat lol... Lasted about six months before excuses were made and site deleted. I decide now traffic is worth more than stupid amounts of downloads and uses alot less bandwidth pmpl... I now have downloads like scripts, icons, php snippets, smileys etc and one chat room. Much better ;-) (o an also watch out for little terrors with rubbish sites linking to your downloads grrr lol)
  8. wappy

    Download Script

    This isn't an ideal way to get the code but here anyway... Go to cult.trap17.com (with opera or another wap emulator) and type wapbuddy to the search box there.. This script can do what you ask but it is for mobile/wap sites but you can grab the php from it eh... To see a very updated version click any of the folders on the wap site i mentioned. Sorry i can't give a web example but i build wap not web sites ;-)---updated site url in my post (site moved)
  9. This is a source code viewer that will workl on wap/mobile sites but you can easily convert it to work on web im sure ;-) <?header("Content-Type: text/vnd.wap.wml");echo '<?xml version="1.0" encoding="utf-8"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://forums.xisto.com/no_longer_exists/ http-equiv="Cache-Control" content="no-cache" forua="true"/></head><card title="s60.nerds.at">'; print "<p>";if ($url == "") { echo "<small><b>Enter url:</b></small><br/><input type=\"text\" name=\"url\" maxlength=\"999\" value=\"http://\" emptyok=\"false\"/><br/><small><anchor>»View source code<go href=\"$PHP_SELF?url=$(url)\" method=\"post\"><postfield name=\"url\" value=\"$(url)\"/></go></anchor></small>"; }if ($url == "$url") { $udata=@file_get_contents("$url");$udata = str_replace("$","$$",$udata);$udata = str_replace("&","&",$udata);$udata = str_replace("'","'",$udata);$udata = str_replace("<","<",$udata);$udata = str_replace(">",">",$udata);$udata = str_replace("\"",""",$udata);$udata = str_replace("-","­",$udata); echo "<small><small>$udata</small></small><br/>"; }if ($udata==!""){echo "---<br/><small><a href=\"$PHP_SELF\">«Back</a></small><br/>";} echo "<small>---<br/><a href=\"index.php\">s60.nerds.at HOME</a><br/>---<br/>© wappyCULT 2006-2007</small>";echo "</p> </card> </wml>";?>
  10. Is the other server with the files you with to move yours or you have access to it?? If yes use ftp functions. You can find on php.net. Or i think you can do it with the copy command if the destination folder is chmod 0777 maybe like this but i could be wrong ok... <?$source="http://cul.t34.biz/neocult.jpg";$destination="destdir/neocult.jpg";copy ($source, $destination);//thats it (i think)?>
  11. Can someone please tell me which of the free forum scripts is the best and why? I like these forums but i notice the script is not free lol ;-)
  12. Hi, can someone please give me an example of how to send a zip or other filetype as an attachment using the mail() command?Im also interested in sending to mail email address, for example i have a .txt file full of email addy's like:mail1@blah.netmail2@blah.netmail3@blah.nethow can i send the file and or mail to all these addy's in one go? Mmm..
  13. Yeah the random password thing can come in handy for email registration etc.
  14. There are loads of ways to learn php, i started by just downloading loads of free scripts and installing/updating them. Now i use php.net everyday to learn new commands and functions. Phpbuilder is also good but too many adverts for my liking. Once you understand how the code needs to be laid out it becomes alot more easy. I mostly use php/wml pages as i create mobile/wap sites not web ;-)
  15. Here is a function you can use to generate a simple random password for whatever use ;-) <?function rand_pass($numchar){$string = str_shuffle ("abcdefghijklmnopqrstuvwxyz1234567890");$password = substr ($string, 1, $numchar);return ($password);}//exampleecho rand_pass('8'); // will return an 8 character long random password of numbers and letters like c8k4ss42?> Notice from serverph: CODE tags added. Here is an extremly usefull search function that will search a directory and its subdirectories for files including the given keyword and display a link to these files. I have made some great file search systems for wap sites using this ;-) <?function search($target, $directory){ if(is_dir($directory)){ $direc = opendir($directory); while(false !== ($file = readdir($direc))){ if($file !="." && $file != ".."){ if(is_file($directory."/".$file)){ if(preg_match("/$target/i", $file)){$size = round(filesize($directory."/".$file)/1024,1); echo "<a href=\"$directory/$file\">$file ($size KB)</a><br>"; } }else if(is_dir($directory."/".$file)){ search($target,$directory."/".$file); } } } closedir($direc); } return;}?> Notice from serverph: CODE tags added. If you use (or have ever stopped using mobiliichat due to the stupid clone bug...) READ THIS! <?//anti-CLONE v1.0 by wappy////this i mainly designed for the cloning problem thats bugged mobiliichat (a cool wap chat script i used as base code for my WAP CHAT) since its release. Hope you can make good use of it. I have lol!!!!////Š wappyCULT 2006-2007////!!DO NOT REMOVE HEADER!!////if your using this on your site then sure remove this crap! But if you plan to give it out please keep the original contents intact!!!!!////!!PUT THE FUNCTION UP HIGH ON YOUR PAGE SO IT CAN BE USED ANYWHERE!!////build our function anti-CLONE!!!!! This is most of the important stuff out the way but we need to do a little more protection after he he he he he... Dumb clones..//function anti_clone($string){return ereg_replace ("[^[:space:]a-zA-Z0-9*_:-]", "", $string);}//ENTER THIS PART WHERE YOU NEED IT!////enter the value you want to protect from cloning, for mobilichat it is $nimi or you can see the general idea by now you can work it out and make your own layout... God im bored pmpl...//$value_to_protect = YOUR_VALUE;//use our anti-CLONE function!!!!!//$value_to_protect = anti_clone($value_to_protect);//add even more protection from enters an returns!!!!!//$value_to_protect = ereg_replace("\n", "", $value_to_protect);$value_to_protect = ereg_replace("\r", "", $value_to_protect);//strip any unwanted tags//$value_to_protect = striptags ($value_to_protect);//make sure all letters are small!!!!!//$value_to_protect = strtolower ($value_to_protect);//enter your value again here... Last bit now pmpl//YOUR_VALUE = $value_to_protect;//THATS IT YOUR VALUE WILL NOW BE SAFE FROM spaces, symbols, funny A's, tags, enters, returns an all the other crap these idiots try ha... Im SURE ITS SAFE NOW! Someone should of done this along time ago!! If you find a gap mail me asap with details!!////if you try and claim you wrote this grrr at you, it because i spent hours on this cool mobiilichat BUG FIX!! lol!!!!// //if you can't get this to work or need help etc... I couldn't give a ????... If however you wanna share/trade scripts etc mail me at wappyCULT@gmail.com////wappy from wappyCULT//?> Notice from serverph: CODE tags added. This is a good example of the strrev() command//// I used this simple function to determine the file extension of files on my site so i can put a unique icon next to each file thats listed. If you would like the icons (they are very small as designed for mobile/wap sites) you can get them at my wap site http://forums.xisto.com/no_longer_exists/ (please ignore the rude message at top its a test site i use for stuff ok) <?//icon code$icon = "unknown.gif";$rev = strrev ($file_name);$exp = explode (".", $rev);$true = strrev ($exp[0]);$trueext = strtolower ($true);if ($trueext=="zip" OR $trueext=="rar" OR $trueext=="gz"){$icon = "zip.gif";}if ($trueext=="amr"){$icon = "amr.gif";}if ($trueext=="midi"){$icon = "midi.gif";}if ($trueext=="mid"){$icon = "mid.gif";}if ($trueext=="gif"){$icon = "gif.gif";}if ($trueext=="jpeg"){$icon = "jpeg.gif";}if ($trueext=="jpg"){$icon = "jpg.gif";}if ($trueext=="jad"){$icon = "jad.gif";}if ($trueext=="jar"){$icon = "jar.gif";}if ($trueext=="sis"){$icon = "sis.gif";}if ($trueext=="bmp"){$icon = "bmp.gif";}if ($trueext=="wbmp"){$icon = "wbmp.gif";}if ($trueext=="txt"){$icon = "txt.gif";}if ($trueext=="avi"){$icon = "avi.gif";}if ($trueext=="thm"){$icon = "thm.gif";}if ($trueext=="nth"){$icon = "nth.gif";}if ($trueext=="png"){$icon = "png.gif";}if ($trueext=="mmf"){$icon = "mp4.gif";}if ($trueext=="wav"){$icon = "wav.gif";}?> Notice from serverph: CODE tags added. Here are a few snippets i was given by PhoenixBytes ;-) ///////////////////////////////////////////////////////////////////////////////////////// this is the code i use for my search engine,// the first if statement checks to see if this process has been done before or not, // $stringy is only passed from the previous page with the cearch box on it, not from any 'back' or next links.// the back and next links pass the $trimm variable//// so, if $trimm is empty, we must run $stringy through this code.// if trim is NOT empty, we put $trimm through instead//// both variables are imported with the $malteasers variable///////////////////////////////////////////////////////////////////////////////////////if ($stringy == "") $malteasers = "$trimm";else $malteasers = "$stringy";$trimmed = trim($malteasers);// this determines what characters can be used as a splitter, i.e 'space (%20)'// this is so you can search for "chicken soup", "chicken" and "soup" all in one single query!$trimmed_array = explode(" .%20.%2C.%26.%3F.%40",$trimmed); // this foreach call was cut from my code (my code is on a loop)// so this may work straight away or may need some editing,foreach ($trimmed_array as $trimm);// look for a slashif (preg_match ("/\"/i", "$trimm")){// do something with a function i'm sure is wrong, i may have taken a long way round when i was less experienced.// $trimm = eregi_replace("/\"","",$trimm); might have worked instead of all the minusers and nudgers being needed!$minuser = "2";$trimm = eregi_replace("\"","",$trimm);$preparetoslice = strlen("$trimm");$sliceoffset = ($preparetoslice - $minuser);$nudger = "1";$trimm = substr($trimm,$nudger,$sliceoffset);}$query = "select count(*) from my_links where keywords LIKE '%$trimm%' AND valid='yes'";$result = mysql_query($query);$count = number_format(mysql_result($result,0,"count(*)"));//// if you wan't an ACCURATE search, let your text box pass a variable// called $stringy//// then replace the database code with your own, but, keep the "where keywords LIKE '%$trimm%'" part!//// and that should be it, good luck with search!///////////////////////////////////////////////////////////////////////////////////////////////////////// Random link generation://$query = "SELECT * from randylinks ORDER BY RAND(" . time() . " * " . time() . ") LIMIT 1";$result = mysql_query($query);$num_rows = mysql_num_rows($result);$rowrandy = mysql_fetch_array($result);$linkname = $rowrandy["linkname"];$linkurl = $rowrandy["linkurl"];$randylink = "<a href=\"$linkurl\">$linkname</a>";////// just alter your database details to get this one working// you need a db table that supplies a linkurl and a linktext//// optionally you can easilly add an image into it to create an image link//////////////////////////////////////////////////////////////////////////////////////////////////////// MAKE WML COMPAT//// this is my make_wml_compat function, it should work though i have had issues with the carriage returns!//function make_wml_compat($string) { $string = ltrim($string); $string = ereg_replace(chr(13),"<br/>",$string); $string = ereg_replace(chr(10),"<br/>",$string); $string = ereg_replace("ś","<br/>",$string); $string = ereg_replace("ľ"," ",$string); $string = ereg_replace("===","<br/>",$string); $string = ereg_replace("\n","<br/>",$string); $string = ereg_replace("\r","<br/>",$string); $string = ereg_replace("&","&",$string); $string = ereg_replace("\\$","$",$string); $string = ereg_replace("\","Ł",$string); $string = ereg_replace("<","<",$string); $string = ereg_replace(">",">",$string); $string = ereg_replace("","-1",$string); $string = ereg_replace("","-2",$string); $string = ereg_replace("","-3",$string); $string = ereg_replace("","-euro",$string); $string = ereg_replace("","Š",$string); $string = ereg_replace("","Ž",$string); $string = ereg_replace("~club","♣",$string); $string = ereg_replace("~spade","♠",$string); $string = ereg_replace("~heart","♥",$string); $string = ereg_replace("~diamond","♦",$string); $string = ereg_replace("~1","š",$string); $string = ereg_replace("~2","˛",$string); $string = ereg_replace("~3","ł",$string); $string = ereg_replace("~half","˝",$string); $string = ereg_replace("~quart","ź",$string); $string = ereg_replace("~euro","",$string); $string = ereg_replace("~dot","",$string); return $string; }////// this SHOULD work, however, different servers run different versions of php etc, so if you get an error on// say, line 3452345, then find the symbol on that line and google php escape %symbol% // an escape is to stop php parsing it, look at the dollar sign up there,// it's escaped with two back slashes. //// you can use the above function like this: make_wml_compat("$text");// it will do nothing if you don't call it.//// enjoy!///////////////////////////////////////////////////////////////////////////////////////////////////ŠPhoenixBytes Notice from serverph: CODE tags added. and finally merged FIVE successive posts in same thread. warning served as well. please review Xisto forum rules & TOS here.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.