├── config.inc.php ├── images ├── digg.png ├── footer.jpg ├── header.jpg ├── reddit.png ├── spacer.gif ├── body-bg.gif ├── main-bg.jpg ├── top-left.jpg ├── delicious.png ├── menu-jokes.gif ├── menu-search.gif ├── body-bg-home.jpg ├── body-bg-view.jpg ├── menu-item-off.gif ├── menu-item-on.gif ├── small-stars-0.gif ├── small-stars-1.gif ├── small-stars-2.gif ├── small-stars-3.gif ├── small-stars-4.gif ├── small-stars-5.gif ├── body-bg-browse.jpg ├── body-bg-contact.jpg ├── body-bg-jokeday.jpg ├── body-bg-random.jpg ├── body-bg-submit.jpg └── body-bg-categories.jpg ├── offline ├── main-design.png └── small stars.png ├── ARW Scripts.url ├── function-library.php ├── db_connect.php ├── links.inc.php ├── .htaccess ├── random-joke.html ├── ___SETUP_INSTRUCTIONS.txt ├── partners.html ├── ___LICENCE.txt ├── footer.php ├── styles.css ├── admin ├── index.html └── viewitem.html ├── README.md ├── browse.html ├── contact-us.html ├── search.html ├── index.html ├── submit-joke.html ├── categories.html ├── viewitem.html └── header.php /config.inc.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/config.inc.php -------------------------------------------------------------------------------- /images/digg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/digg.png -------------------------------------------------------------------------------- /images/footer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/footer.jpg -------------------------------------------------------------------------------- /images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/header.jpg -------------------------------------------------------------------------------- /images/reddit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/reddit.png -------------------------------------------------------------------------------- /images/spacer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/spacer.gif -------------------------------------------------------------------------------- /images/body-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/body-bg.gif -------------------------------------------------------------------------------- /images/main-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/main-bg.jpg -------------------------------------------------------------------------------- /images/top-left.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/top-left.jpg -------------------------------------------------------------------------------- /images/delicious.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/delicious.png -------------------------------------------------------------------------------- /images/menu-jokes.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/menu-jokes.gif -------------------------------------------------------------------------------- /images/menu-search.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/menu-search.gif -------------------------------------------------------------------------------- /images/body-bg-home.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/body-bg-home.jpg -------------------------------------------------------------------------------- /images/body-bg-view.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/body-bg-view.jpg -------------------------------------------------------------------------------- /images/menu-item-off.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/menu-item-off.gif -------------------------------------------------------------------------------- /images/menu-item-on.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/menu-item-on.gif -------------------------------------------------------------------------------- /images/small-stars-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/small-stars-0.gif -------------------------------------------------------------------------------- /images/small-stars-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/small-stars-1.gif -------------------------------------------------------------------------------- /images/small-stars-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/small-stars-2.gif -------------------------------------------------------------------------------- /images/small-stars-3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/small-stars-3.gif -------------------------------------------------------------------------------- /images/small-stars-4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/small-stars-4.gif -------------------------------------------------------------------------------- /images/small-stars-5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/small-stars-5.gif -------------------------------------------------------------------------------- /offline/main-design.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/offline/main-design.png -------------------------------------------------------------------------------- /offline/small stars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/offline/small stars.png -------------------------------------------------------------------------------- /images/body-bg-browse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/body-bg-browse.jpg -------------------------------------------------------------------------------- /images/body-bg-contact.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/body-bg-contact.jpg -------------------------------------------------------------------------------- /images/body-bg-jokeday.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/body-bg-jokeday.jpg -------------------------------------------------------------------------------- /images/body-bg-random.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/body-bg-random.jpg -------------------------------------------------------------------------------- /images/body-bg-submit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/body-bg-submit.jpg -------------------------------------------------------------------------------- /images/body-bg-categories.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mfscripts/Joke-Site-Script-Free/master/images/body-bg-categories.jpg -------------------------------------------------------------------------------- /ARW Scripts.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=http://www.arwscripts.com/ 3 | IDList= 4 | [{000214A0-0000-0000-C000-000000000046}] 5 | Prop3=19,2 6 | -------------------------------------------------------------------------------- /function-library.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /db_connect.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /links.inc.php: -------------------------------------------------------------------------------- 1 | Full Website Scripts
4 | ?> 5 | - Cheap Web Hosting
6 | - Full Website Scripts
-------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | AddType application/x-httpd-php .html 2 | RewriteEngine on 3 | RewriteRule ^browse-(.*)_page-(.*).html$ browse.html?let=$1&start=$2 [QSA] 4 | RewriteRule ^jokes_(.*)_page-(.*).html$ categories.html?cat=$1&start=$2 [QSA] 5 | RewriteRule ^jokes_(.*).html$ categories.html?cat=$1 [QSA] 6 | RewriteRule ^view-(.*)-(.*).html$ viewitem.html?j=$1 [QSA] 7 | RewriteRule ^viewr-(.*)-(.*).html$ viewitem.html?j=$1&r=1 [QSA] -------------------------------------------------------------------------------- /random-joke.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /___SETUP_INSTRUCTIONS.txt: -------------------------------------------------------------------------------- 1 | Setup Instructions: 2 | 3 | - Upload the main zip file to your hosting area. 4 | - Unzip the zip file ensuring all folders are kept. 5 | - Amend config.inc.php with your site_name, site_url along with other optional amendments. 6 | - Create a new database in mysql. 7 | - Import the .sql file stored within the sql directory. 8 | - Update db_connect.php in the root to connect correctly to your mysql database. 9 | - Add a http username/password to the admin directory. 10 | 11 | You should now be set to go! 12 | 13 | Check out http://mfscripts.com/ for other PHP scripts! 14 | -------------------------------------------------------------------------------- /partners.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | 24 | 25 |
18 | Partners of ".$site_name.":

"; 20 | echo "Here are some sites we think you may find interesting. If you would like to exchange links with us, please contact us with the details of your link and where a backlink is located using the contact page.

"; 21 | include("links.inc.php"); 22 | ?> 23 |
26 | 27 | -------------------------------------------------------------------------------- /___LICENCE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 MFScripts http://mfscripts.com/ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'LINKS', 'title'=>'link partners', 'url'=>$site_path.'partners.html'); 14 | $nav = ""; 15 | foreach($main_nav AS $this_nav) { 16 | if($this_nav[pagecode] == $selected) $nav .= ""; 17 | $nav .= "".$this_nav[title].""; 18 | if($this_nav[pagecode] == $selected) $nav .= ""; 19 | $nav .= " | "; 20 | } 21 | $nav = substr($nav, 0, strlen($nav)-49); 22 | echo $nav; 23 | ?> 24 | 25 | 26 | 27 | 28 | Copyright © - Joke site script developed by ARWScripts.com 29 | 30 | 31 | 32 | 33 |   34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Verdana, Arial, Helvetica, sans-serif; 3 | font-size: 11px; 4 | color: #453159; 5 | } 6 | td,th { 7 | font-family: Verdana, Arial, Helvetica, sans-serif; 8 | font-size: 11px; 9 | color: #453159; 10 | } 11 | input, textarea, select { 12 | border-style:solid; 13 | border-width:1px; 14 | border-color:#666666; 15 | font-size:13px; 16 | color:#000000; 17 | } 18 | a { 19 | font-size: 11px; 20 | text-decoration: underline; 21 | color: #444444; 22 | } 23 | a:hover { 24 | font-size: 11px; 25 | text-decoration: none; 26 | color: #A392B4; 27 | } 28 | .slogan { 29 | font-family: Verdana, Arial, Helvetica, sans-serif; 30 | font-size: 10px; 31 | font-weight: bold; 32 | color: #FFFFFF; 33 | } 34 | .mainnav { 35 | font-size: 13px; 36 | text-decoration: none; 37 | color: #2A2A2A; 38 | } 39 | .mainnav:hover { 40 | font-size: 13px; 41 | text-decoration: underline; 42 | color: #2A2A2A; 43 | } 44 | .mainnavbreak { 45 | color: #9A7A1B; 46 | } 47 | .footer { 48 | font-size: 9px; 49 | text-decoration: none; 50 | color: #CCCCCC; 51 | } 52 | .footer a:hover { 53 | font-size: 9px; 54 | text-decoration: underline; 55 | color: #CCCCCC; 56 | } 57 | .footernav a { 58 | font-size: 10px; 59 | text-decoration: none; 60 | color: #FFFFFF; 61 | } 62 | .footernav a:hover { 63 | font-size: 10px; 64 | text-decoration: underline; 65 | color: #FFFFFF; 66 | } 67 | .menuheader { 68 | font-size: 12px; 69 | color: #FFFFFF; 70 | font-weight: bold; 71 | } 72 | .menuitem { 73 | font-size: 10px; 74 | text-decoration: none; 75 | font-weight: bold; 76 | color: #453159; 77 | } 78 | .menuitem a:hover { 79 | font-size: 10px; 80 | text-decoration: underline; 81 | font-weight: bold; 82 | } 83 | .smallBr{ 84 | font-size: 1px; 85 | line-height: 2; 86 | } 87 | .listingtitle { 88 | color: #D01F3C; 89 | } 90 | .morelink a { 91 | font-size: 11px; 92 | text-decoration: underline; 93 | color: #A392B4; 94 | } 95 | .morelink a:hover { 96 | font-size: 11px; 97 | text-decoration: none; 98 | color: #A392B4; 99 | } 100 | .smallform { 101 | border-style:solid; 102 | border-width:1px; 103 | border-color:#666666; 104 | font-size:10px; 105 | color:#666666; 106 | } 107 | .jokeview { 108 | font-size:16px; 109 | font-weight:bold; 110 | color: #333333; 111 | } -------------------------------------------------------------------------------- /admin/index.html: -------------------------------------------------------------------------------- 1 | 32 | 33 | 34 | 35 | 41 | 42 |
36 | Approve New Jokes:

"; 38 | echo "Listed below are all the pending jokes on the system. Choose the relevant option next to each item to approve or remove the joke.

"; 39 | ?> 40 |
43 | 44 | "; 46 | if(mysql_numrows($pending) > 0) { 47 | $tracker = $start+1; 48 | while($row = mysql_fetch_array($pending)) { 49 | echo "
".$tracker.".   Category: ".$row[category]." 
"; 50 | echo "".trim(substr(stripslashes($row[joke]), 0, 120))."... more

"; 51 | $tracker++; 52 | } 53 | } 54 | else echo "
 There are currently no pending jokes.

"; 55 | echo ""; 56 | ?> 57 | 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Jokes Site Script Free

2 | Create your own jokes site with this free jokes site script. 3 | 4 |

About Jokes Site Script Free

5 | This jokes site script allows you to create a joke site containing nearly 10,000 jokes. 6 | 7 | This is a community based release that is supplied without support or liability. You are free to use the jokes site script as you wish. The only restriction to this PHP script is that this README file must not be edited or deleted. 8 | 9 |

Features:

10 | - Written in php/mysql. 11 | - All pages are created using Apaches mod-rewrite so any recipe page all look like static pages within the search engines. 12 | - Comes with nearly 10,000 funny jokes. 13 | - Jokes managed into over 100 different categories. 14 | - Search feature which searches jokes and categories. 15 | - Submit jokes feature for visitors to add jokes. 16 | - Basic admin area to approve/decline submitted jokes. 17 | - Rating/stars feature for each joke. 18 | - Links to digg, del.icio.us and reddit included on every joke. 19 | - Random Joke feature. 20 | - All content is automatically managed 21 | - i.e. homepage is updated automatically. 22 | - 'Friends' page for ease of management of links exchanges. 23 | - Control the amount of items displayed within search results/browsing via the config. 24 | - Use html code within added jokes. 25 | - Original design fireworks png file included. 26 | - Ideal for adding adsense or other code. 27 | 28 |

Requirements

29 | - php 4.x 30 | - mysql 31 | - mod rewrite module on apache 32 | - HD/BW requirements will vary on your traffic, scripts require about 100kb. 33 | 34 |

Installation

35 | Full instructions are given in the ___SETUP_INSTRUCTIONS.txt file found within the repository. 36 | 37 |

Contributions

38 | If you'd like to contribute to the project, please contact us via the github project https://github.com/mfscripts/Jokes-Site-Script-Free 39 | 40 |

License

41 | Fonts Site Script Free is copyrighted by MFScripts and is released under the MIT license. You are free to use the jokes site script as you wish. The only restriction to this PHP script is that this README file must not be edited or deleted. 42 | 43 |

Support

44 | This code is released without any support and as-is. Any support requests on this version will be removed. For community driven support please use the github project https://github.com/mfscripts/Jokes-Site-Script-Free 45 | -------------------------------------------------------------------------------- /browse.html: -------------------------------------------------------------------------------- 1 | 27 | 28 | 29 | 30 | 44 | 45 |
31 |
32 | $letters[$i]"; 37 | $i++; 38 | if(($i == 15) || ($i == 26)) echo "
"; 39 | else echo " | "; 40 | } 41 | ?> 42 |

43 |
46 | 47 | 0) { 49 | echo ""; 50 | $tracker = $start+1; 51 | while($row = mysql_fetch_array($temp)) { 52 | echo ""; 53 | echo ""; 54 | $tracker++; 55 | } 56 | echo "
".$tracker.".   Category: ".$row[category]."  ".$row[votestartotal]." stars
".trim(substr(stripslashes($row[joke]), 0, 120))."... more

"; 57 | } 58 | ?> 59 | 60 |
61 | $perpage) { 64 | $start2 = $start - ($perpage * 2); 65 | if($start2 < 0) $start2 = 0; 66 | echo "< Previous Page  "; 67 | } 68 | if($start < $total) echo "  Next Page >"; 69 | ?>


70 | 71 | 72 | -------------------------------------------------------------------------------- /admin/viewitem.html: -------------------------------------------------------------------------------- 1 | ERROR!

No joke was requested, please go back to the homepage and start again.
"; 19 | 20 | } 21 | else { 22 | 23 | $jokeqry = mysql_query("SELECT * FROM pendingjokes WHERE id = ".$j." LIMIT 1"); 24 | if($jokeqry) { 25 | $category = mysql_result($jokeqry, 0, category); 26 | $joke = stripslashes(mysql_result($jokeqry, 0, joke)); 27 | $dateadded = mysql_result($jokeqry, 0, dateadded); 28 | $dateadded = substr($dateadded, 8, 2)."/".substr($dateadded, 5, 2)."/".substr($dateadded, 0, 4); 29 | $emailadd = mysql_result($jokeqry, 0, email); 30 | $userip = mysql_result($jokeqry, 0, ip); 31 | } 32 | else die("ERROR LOOKING UP JOKE"); 33 | 34 | $ptitle = substr($joke, 0, 50)."... joke"; 35 | $meta_keys = ""; 36 | $meta_desc = ""; 37 | $selected = "VIEW"; 38 | 39 | include("../header.php"); 40 | 41 | ?> 42 | 43 | 44 | 45 | "; 50 | echo ""; 51 | echo ""; 52 | echo ""; 53 | echo ""; 54 | echo ""; 55 | echo ""; 56 | echo ""; 57 | echo "
46 | "; 48 | echo "
"; 49 | echo "Viewing Joke:

Category:".$category."
Date Added:".$dateadded."
User Email:".$emailadd."
User IP:".$userip."
 
Joke:".$joke."
 
"; 58 | 59 | ?> 60 | 61 | 62 | 63 | 66 | 67 | -------------------------------------------------------------------------------- /contact-us.html: -------------------------------------------------------------------------------- 1 | "; 28 | if(strlen($subject) == 0) $errorstring .="You must specify a subject.
"; 29 | if(strlen($message) == 0) $errorstring .="You have not entered a message.
"; 30 | if(strlen($youremail) < 9 || strlen($youremail) > 64) $errorstring .= "Please enter a valid email address.
"; 31 | else 32 | { 33 | $emailtail = strstr($youremail, '@'); 34 | if(!strstr($youremail, '@') || !strstr($emailtail, '.')) $errorstring .= "Please enter a valid email address.
"; 35 | } 36 | if(strlen($errorstring) == 0){ 37 | $subject = "Contact from the ".$site_name." site - ".$subject; 38 | $sent = mail($site_email, $subject, $message, "FROM: ".$youremail); 39 | if($sent) $showform = FALSE; 40 | } 41 | 42 | } 43 | 44 | 45 | ?> 46 | 47 | 48 | 49 | 74 | 75 |
50 | Contact Us

51 | 52 | 55 | Any questions or comments about the site or services we offer, feel free to contact us using the form below:

56 | NOTE: Please do not use this form for submitting new jokes as they will not be added. Please go here to send us new jokes.

57 | 58 | 67 |

59 | 0) echo "
Error(s) Found:

$errorstring


";?> 60 | 61 | 62 | 63 | 64 | 65 |
Your Email:
Subject:
Message:
  

66 |
68 |
Your comments have been sent to us and you should expect a response within 24 hours.
"; 71 | ?> 72 | 73 |
76 | 77 | 78 | -------------------------------------------------------------------------------- /search.html: -------------------------------------------------------------------------------- 1 | 1) { 10 | 11 | $start = $_REQUEST['start']; 12 | if(!$start) $start = 0; 13 | $page = $start + 50; $page = $page/50; 14 | 15 | $ptitle = $c." search - Page $page"; 16 | $meta_keys = "jokes, funny, laugher, joke, gag, laughing"; 17 | $meta_desc = $c." search - Page $page"; 18 | $selected = "SEARCH"; 19 | 20 | include("header.php"); 21 | 22 | $temp3 = mysql_query("SELECT * FROM jokes WHERE category LIKE '%$c%' OR joke LIKE '%$c%'"); 23 | $temp = mysql_query("SELECT * FROM jokes WHERE category LIKE '%$c%' OR joke LIKE '%$c%' ORDER BY joke LIMIT $start, $perpage"); 24 | $total = mysql_numrows($temp3); 25 | 26 | ?> 27 | 28 | 29 | 30 | 36 | 37 |
31 | ".$total." results for '".$c."':

"; 33 | echo "Your search results are displayed below:

"; 34 | ?> 35 |
38 | 39 | 0) { 41 | echo ""; 42 | $tracker = $start+1; 43 | while($row = mysql_fetch_array($temp)) { 44 | echo ""; 45 | echo ""; 46 | $tracker++; 47 | } 48 | echo "
".$tracker.".   Category: ".$row[category]."  ".$row[votestartotal]." stars
".trim(substr(stripslashes($row[joke]), 0, 120))."... more

"; 49 | } 50 | else echo "
 - There are no results for your search criteria, please try again."; 51 | ?> 52 | 53 |
54 | $perpage) { 57 | $start2 = $start - ($perpage * 2); 58 | if($start2 < 0) $start2 = 0; 59 | echo "< Previous Page  "; 60 | } 61 | if($start < $total) echo "  Next Page >"; 62 | ?>


63 | 64 | 76 | 77 | 78 | 79 | 85 | 86 |
80 | Search For Jokes:

"; 82 | echo "Use the searh box below to search for jokes on this site.

"; 83 | ?> 84 |
87 | 88 |
"; 90 | echo "Criteria:  "; 91 | echo ""; 92 | echo "

"; 93 | ?> 94 | 95 | 98 | 99 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | 67 | 68 |
18 | Welcome to ".$site_name."!

"; 22 | echo $site_name." is packed with ".number_format($total_jokes, 0, 0, ',')." (yes ".convert_number($total_jokes)."!) of the funniest jokes in the world. Use the navigation above to browse, search or submit a joke and more.

"; 23 | 24 | echo "Random Joke Of The Day:

"; 25 | $temp = mysql_query("SELECT * FROM jokes ORDER BY RAND() LIMIT 1"); 26 | if($temp) { 27 | echo ""; 28 | while($row = mysql_fetch_array($temp)) { 29 | echo ""; 30 | echo ""; 31 | } 32 | echo "
   Category: ".$row[category]."  ".$row[votestartotal]." stars
".trim(substr(stripslashes($row[joke]), 0, 120))."... more

"; 33 | } 34 | 35 | echo "
"; 36 | echo "Top 5 Highest Rated Jokes:

"; 37 | $temp = mysql_query("SELECT * FROM jokes ORDER BY votestartotal DESC LIMIT 5"); 38 | if($temp) { 39 | echo ""; 40 | $tracker = $start+1; 41 | while($row = mysql_fetch_array($temp)) { 42 | echo ""; 43 | echo ""; 44 | $tracker++; 45 | } 46 | echo "
".$tracker.".   Category: ".$row[category]."  ".$row[votestartotal]." stars
".trim(substr(stripslashes($row[joke]), 0, 120))."... more

"; 47 | } 48 | echo "
"; 49 | echo "Newest Jokes:

"; 50 | $temp = mysql_query("SELECT * FROM jokes ORDER BY dateadded DESC LIMIT 5"); 51 | if($temp) { 52 | echo ""; 53 | $tracker = $start+1; 54 | while($row = mysql_fetch_array($temp)) { 55 | echo ""; 56 | echo ""; 57 | $tracker++; 58 | } 59 | echo "
".$tracker.".   Category: ".$row[category]."  ".$row[votestartotal]." stars
".trim(substr(stripslashes($row[joke]), 0, 120))."... more

"; 60 | } 61 | echo "
"; 62 | 63 | 64 | 65 | ?> 66 |
69 | 70 | -------------------------------------------------------------------------------- /submit-joke.html: -------------------------------------------------------------------------------- 1 | "; 28 | if(strlen($category) == 0) $errorstring .="You must choose a category.
"; 29 | if(strlen($joke) == 0) $errorstring .="You have not entered a joke.
"; 30 | if(strlen($youremail) < 9 || strlen($youremail) > 64) $errorstring .= "Please enter a valid email address.
"; 31 | else 32 | { 33 | $emailtail = strstr($youremail, '@'); 34 | if(!strstr($youremail, '@') || !strstr($emailtail, '.')) $errorstring .= "Please enter a valid email address.
"; 35 | } 36 | if(strlen($errorstring) == 0){ 37 | // add to pending 38 | $ip = GetHostByName($REMOTE_ADDR); 39 | $insert = mysql_query("INSERT INTO pendingjokes (category, joke, email, ip, dateadded) VALUES ('".formatField($category)."', '".formatField($joke)."', '".formatField($youremail)."', '".$ip."', NOW())"); 40 | if($insert) $showform = FALSE; 41 | } 42 | 43 | } 44 | 45 | 46 | ?> 47 | 48 | 49 | 50 | 84 | 85 |
51 | Submit A Joke

52 | 53 | 56 | Use the following form to submit a new joke to . Please use the search feature first to make sure the joke does not exist alreay.

57 | 58 | 77 |

59 | 0) echo "
Error(s) Found:

$errorstring


";?> 60 | 61 | 62 | 73 | 74 | 75 |
Your Email:
Joke Category:
Joke:
  

76 |
78 |
Your joke has been sent for approval and should appear on the site in 24 hours. Thanks again for your contribution to ".$site_name.".


submit another joke
home"; 81 | ?> 82 | 83 |
86 | 87 | 88 | -------------------------------------------------------------------------------- /categories.html: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | 31 | 37 | 38 |
32 | ".UCWords($cat)." Category:

"; 34 | echo "All our jokes listing within the ".$cat." category are listed below. Click on any of the items to view the full joke.

"; 35 | ?> 36 |
39 | 40 | 0) { 42 | echo ""; 43 | $tracker = $start+1; 44 | while($row = mysql_fetch_array($temp)) { 45 | echo ""; 46 | echo ""; 47 | $tracker++; 48 | } 49 | echo "
".$tracker.".   Category: ".$row[category]."  ".$row[votestartotal]." stars
".trim(substr(stripslashes($row[joke]), 0, 120))."... more

"; 50 | } 51 | ?> 52 | 53 |
54 | $perpage) { 57 | $start2 = $start - ($perpage * 2); 58 | if($start2 < 0) $start2 = 0; 59 | echo "< Previous Page  "; 60 | } 61 | if($start < $total) echo "  Next Page >"; 62 | ?>


63 | 64 | 78 | 79 | 80 | 81 | 87 | 88 |
82 | Choose Category:

"; 84 | echo "Choose from the category listing below to being browsing our jokes by category.

"; 85 | ?> 86 |
89 | 90 | "; 92 | $tracker = 0; 93 | while($row = mysql_fetch_array($cats)) { 94 | // get total 95 | $total = mysql_query("SELECT COUNT(id) AS total FROM jokes WHERE category = '".$row[category]."'"); 96 | $jokes_total = mysql_result($total, 0, total); 97 | if($tracker == 0) echo ""; 98 | echo " - ".$row[category]." (".$jokes_total.")"; 99 | if($tracker == 1) { 100 | echo ""; 101 | $tracker = 0; 102 | } 103 | else $tracker++; 104 | } 105 | echo "
"; 106 | ?> 107 | 108 | 111 | 112 | -------------------------------------------------------------------------------- /viewitem.html: -------------------------------------------------------------------------------- 1 | ERROR!

No joke was requested, please go back to the homepage and start again.
"; 20 | 21 | } 22 | else { 23 | 24 | $vote = $_REQUEST['vote']; 25 | if($vote) { 26 | $lookup_field = "votestar".$vote; 27 | $get_values = mysql_query("SELECT votestar1, votestar2, votestar3, votestar4, votestar5 FROM jokes WHERE id = ".$j." LIMIT 1"); 28 | $votestar1 = mysql_result($get_values, 0, votestar1); 29 | $votestar2 = mysql_result($get_values, 0, votestar2); 30 | $votestar3 = mysql_result($get_values, 0, votestar3); 31 | $votestar4 = mysql_result($get_values, 0, votestar4); 32 | $votestar5 = mysql_result($get_values, 0, votestar5); 33 | if($vote == 1) $votestar1 = $votestar1+1; 34 | elseif($vote == 2) $votestar2 = $votestar2+1; 35 | elseif($vote == 3) $votestar3 = $votestar3+1; 36 | elseif($vote == 4) $votestar4 = $votestar4+1; 37 | elseif($vote == 5) $votestar5 = $votestar5+1; 38 | $total = ($votestar1 * 1)+($votestar2 * 2)+($votestar3 * 3)+($votestar4 * 4)+($votestar5 * 5); 39 | $total = $total/($votestar1+$votestar2+$votestar3+$votestar4+$votestar5); 40 | $update_joke = mysql_query("UPDATE jokes SET ".$lookup_field." = ".$$lookup_field.", votestartotal = ".$total." WHERE id = ".$j." LIMIT 1"); 41 | } 42 | 43 | $jokeqry = mysql_query("SELECT * FROM jokes WHERE id = ".$j." LIMIT 1"); 44 | if($jokeqry) { 45 | $category = mysql_result($jokeqry, 0, category); 46 | $joke = stripslashes(mysql_result($jokeqry, 0, joke)); 47 | $dateadded = mysql_result($jokeqry, 0, dateadded); 48 | $dateadded = substr($dateadded, 8, 2)."/".substr($dateadded, 5, 2)."/".substr($dateadded, 0, 4); 49 | $votestartotal = mysql_result($jokeqry, 0, votestartotal); 50 | $views = mysql_result($jokeqry, 0, views); 51 | 52 | $newviews = $views+1; 53 | $update = mysql_query("UPDATE jokes SET views = ".$newviews." WHERE id = ".$j." LIMIT 1"); 54 | } 55 | else die("ERROR LOOKING UP JOKE"); 56 | 57 | $ptitle = substr($joke, 0, 50)."... joke"; 58 | $meta_keys = str_replace(" ", ", ", substr($joke, 0, 50)).", search, jokes, funny, laugher, joke, gag, laughing"; 59 | $meta_desc = substr($joke, 0, 50)."... joke"; 60 | if($r == 1) $selected = "RANDOM"; 61 | else $selected = "VIEW"; 62 | 63 | include("header.php"); 64 | 65 | ?> 66 | 67 | 68 | 69 | "; 76 | echo ""; 77 | echo ""; 78 | if(number_format($votestartotal, 0) == 0) $rating = "not yet rated"; 79 | else $rating = number_format($votestartotal, 0)." stars"; 80 | echo ""; 90 | echo ""; 91 | echo ""; 92 | echo ""; 93 | echo ""; 94 | $this_url = $site_path."view-".$j."-".trim(substr(urlconvert($joke), 0, 50)).".html"; 95 | $this_title = trim(substr($joke, 0, 50)); 96 | echo ""; 101 | 102 | echo "
70 | "; 72 | echo "
"; 73 | if($r == 1) echo "Random"; 74 | else echo "Viewing"; 75 | echo " Joke:

Category:".$category."
Date Added:".$dateadded."
Rating:".$rating.""; 81 | if(!$vote) echo "     "; 89 | echo "
Views:".$newviews."
 
Joke:".$joke."
 
97 |  Add to del.icio.us   98 |  Digg this   99 |  Reddit 100 |
"; 103 | 104 | ?> 105 | 106 | 107 |

More :

108 | 109 | 110 | "; 114 | $tracker = 1; 115 | while($row = mysql_fetch_array($temp)) { 116 | echo "".$tracker.".   Category: ".$row[category]."  ".$row[votestartotal]." stars"; 117 | echo "".trim(substr(stripslashes($row[joke]), 0, 120))."... more

"; 118 | $tracker++; 119 | } 120 | echo "
"; 121 | ?> 122 | 123 | 126 | 127 | -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | 2 | 'HOME', 'title'=>'home', 'url'=>$site_path.'index.html'); 10 | $main_nav[] = array('pagecode'=>'CATEGORIES', 'title'=>'categories', 'url'=>$site_path.'categories.html'); 11 | $main_nav[] = array('pagecode'=>'BROWSE', 'title'=>'a to z browse', 'url'=>$site_path.'browse.html'); 12 | $main_nav[] = array('pagecode'=>'SEARCH', 'title'=>'search', 'url'=>$site_path.'search.html'); 13 | $main_nav[] = array('pagecode'=>'RANDOM', 'title'=>'random joke', 'url'=>$site_path.'random-joke.html'); 14 | $main_nav[] = array('pagecode'=>'SUBMIT', 'title'=>'submit joke', 'url'=>$site_path.'submit-joke.html'); 15 | $main_nav[] = array('pagecode'=>'CONTACT', 'title'=>'contact us', 'url'=>$site_path.'contact-us.html'); 16 | 17 | // 'JOKES' left menu contents 18 | // this must be x items of less 19 | $jokes_nav = array(); 20 | $jokes_nav[] = array('title'=>'Random Joke', 'url'=>$site_path.'random-joke.html'); 21 | $jokes_nav[] = array('title'=>'Knock Knock', 'url'=>$site_path.'jokes_knock-knock-jokes.html'); 22 | $jokes_nav[] = array('title'=>'Music Jokes', 'url'=>$site_path.'jokes_music-jokes.html'); 23 | $jokes_nav[] = array('title'=>'Internet Jokes', 'url'=>$site_path.'jokes_internet-jokes.html'); 24 | $jokes_nav[] = array('title'=>'Lawyer Jokes', 'url'=>$site_path.'jokes_lawyer-jokes.html'); 25 | $jokes_nav[] = array('title'=>'Marriage Jokes', 'url'=>$site_path.'jokes_marriage-jokes.html'); 26 | $jokes_nav[] = array('title'=>'Yo Momma Jokes', 'url'=>$site_path.'jokes_yo-momma-jokes.html'); 27 | $jokes_nav[] = array('title'=>'Cowboy Jokes', 'url'=>$site_path.'jokes_cowboy-jokes.html'); 28 | $jokes_nav[] = array('title'=>'Accountant Jokes', 'url'=>$site_path.'jokes_accountant-jokes.html'); 29 | $jokes_nav[] = array('title'=>'Women Jokes', 'url'=>$site_path.'jokes_women-jokes.html'); 30 | $jokes_nav[] = array('title'=>'Men Jokes', 'url'=>$site_path.'jokes_men-jokes.html'); 31 | $jokes_nav[] = array('title'=>'More...', 'url'=>$site_path.'categories.html'); 32 | 33 | ?> 34 | 35 | 36 | 37 | <?php echo $ptitle; ?> - <?php echo $site_name; ?> 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 | 47 | 48 | 49 | 73 | 74 | 75 |
50 | 51 | 52 | 55 | 56 | 57 | 70 | 71 |
53 | 54 |
58 | "; 62 | $nav .= "".$this_nav[title].""; 63 | if($this_nav[pagecode] == $selected) $nav .= ""; 64 | $nav .= " | "; 65 | } 66 | $nav = substr($nav, 0, strlen($nav)-49); 67 | echo $nav; 68 | ?> 69 |
72 |
76 | 77 | 78 | 79 | 135 | 138 |
80 | 81 | 82 | 83 | 86 | 87 | 88 | 91 | 105 | 106 |
84 | 85 |
89 | 90 | 92 |

93 | JOKES :: 94 |




95 | 96 | "; 100 | $tracker++; 101 | } 102 | ?> 103 |
104 |
107 | 108 | 109 | 110 | 113 | 114 | 115 | 118 | 129 | 130 |
111 | 112 |
116 | 117 | 119 |

120 | SEARCH :: 121 |




122 | 123 | 124 | 125 | 126 | 127 |
Find:
128 |
131 | 132 |
133 | 134 |
136 | 137 | 139 | 140 | 141 |
--------------------------------------------------------------------------------