<?php
/**********************************************************
* ______ ______ ___ _______ ___ ___ _______ *
* | _ \ | _ \ | | | _ || Y || _ | *
* |. | \|. | \|. | |. 1___||. || 1___| *
* |. | |. | |. |___ |. |___ |. \_/ ||____ | *
* |: 1 |: 1 |: 1 ||: 1 ||: | ||: 1 | *
* |::.. . /|::.. . /|::.. . ||::.. . ||::.|:. ||::.. . | *
* `------' `------' `-------'`-------'`--- ---'`-------' *
* _______ _______ *
* .--.--. | _ | | | *
* | | | |___| | __ |___| | *
* \___/ _(__ | |__| / ___/ *
* |: 1 | |: 1 \ *
* |::.. . | |::.. . | *
* `-------' `-------' *
* *
* Script: DDLCMS v3.2 *
* Author: Little Dragon *
* Email: hide@address.com *
* Website: http://www.ddlcms.com *
* *
* Please direct bug reports, suggestions or feedback *
* to the DDLCMS forums: *
* *
* http://www.ddlcms.com/forums *
* *
* DDLCMS is a commercial grade content management *
* system for DDL site owners. It is provided free *
* of charge, provided: *
* *
* 1. You keep the linkback to http://www.ddlcms.com *
* in the footer. *
* *
* 2. You keep the sponsored links to Sharingzone.net *
* on your site. *
* *
* By using this script, you agree that you will not *
* modify, remove, or replace any encoded parts of *
* this script. All encoded parts MUST remain intact *
* for your site to remain in good standing. *
* *
**********************************************************/
if(function_exists('dwvomyj38aci9v0f9hrdoj0cx0p1xpwgwnf2e1p4whp4h8hj6flfhotv8vzjb2ysn70164qe') !== TRUE)
{
exit('<h1>Illegal script modification!</h1>');
}
# MySQL host - usually localhost
define('MYSQLHOST', '##MYSQLHOST##');
# MySQL username
define('MYSQLUSER', '##MYSQLUSER##');
# MySQL password
define('MYSQLPASSWD', '##MYSQLPASSWD##');
# Your MySQL database
define('MYSQLDB', '##MYSQLDB##');
function dbcom($query)
{
if(isset($query) === TRUE && empty($query) === FALSE & strlen($query) > 0)
{
$dbLink = mysql_connect(MYSQLHOST, MYSQLUSER, MYSQLPASSWD);
mysql_select_db(MYSQLDB, $dbLink);
$theResult = mysql_query($query, $dbLink);
if($theResult === FALSE)
{
echo mysql_error($dbLink);
return FALSE;
}
else
{
return $theResult;
}
mysql_close($dbLink);
}
else
{
return NULL;
}
}
function getConfig()
{
$configQuery = dbcom('SELECT * FROM config LIMIT 1;');
$configArray = mysql_fetch_assoc($configQuery);
# this will be changed when this is turned into an actual object. leave it for now
global $siteID, $site_url, $site_name, $admin_email, $keywords, $description, $votelink, $cbusername, $camsusername, $videoszusername, $skin, $hovercolor, $menualign, $showTop5, $showInstantLE, $showTopSearches, $topsearches, $showRecentSearches, $recentsearches, $showRecentDownloads, $recentdownloads, $showSponsoredLinks, $topdownloads, $sponsoredSearchResults, $pagelimit, $pagenumbers, $max_dl, $max_que, $date_format, $siteNameLength, $whitelist_threshold, $deadlink_threshold, $auto_allow, $maximumsubmissions, $publicAutoSubmitter, $enableAutoResponder, $failedSubmitURLtries, $arrowsForProvider, $instantLEnotify, $instantLEmaxLinks, $instantLEclean, $instantLEsort, $partnerLinksSort, $categories;
# Site ID - mostly used for forms
$siteID = $configArray['siteID'];
# Your sites url WITHOUT trailing slash /
$site_url = $configArray['site_url'];
# Your site's name - keep it simple eg. "DDLCMS.com"
$site_name = $configArray['site_name'];
# Your e-mail
$admin_email = $configArray['admin_email'];
# Each keyword separated by comma
$keywords = $configArray['keywords'];
$description = $configArray['description'];
# Porn sponsor link or website to send your surfers to (displayed on Xxx page)
$votelink = $configArray['votelink'];
# Your Clickbank User Name (If you don't have one, you can sign up for free here: https://www.clickbank.com/affiliateAccountSignup.htm)
$cbusername = $configArray['cbusername'];
# Your Cams.com User Name (If you don't have one, you can sign up for free here: http://cams.com/go/g656263-brk)
$camsusername = $configArray['camsusername'];
# Your Videosz.com User Name (If you don't have one, you can sign up for free here: http://webmasters.videosz.com/index.php?webmaster_id=8006)
$videoszusername = $configArray['videoszusername'];
# The skin to use under the "skins" folder
$skin = $configArray['skin'];
# The background color of each line in the DDL list ON MOUSEOVER
$hovercolor = $configArray['hovercolor'];
# The top floating menu position, must be left, right, or center
$menualign = $configArray['menualign'];
# Whether to show the "Top 5 Downloads This Week" section ("Yes" or "No")
$showTop5 = $configArray['showTop5'];
# Whether to show the Instant Link Exchange Partners section ("Yes" or "No")
$showInstantLE = $configArray['showInstantLE'];
# Whether to show the Top Searches section ("Yes" or "No")
$showTopSearches = $configArray['showTopSearches'];
# The number of top search terms to show
$topsearches = $configArray['topsearches'];
# Whether to show the Recent Searches section ("Yes" or "No")
$showRecentSearches = $configArray['showRecentSearches'];
# The number of recent searches to show
$recentsearches = $configArray['recentsearches'];
# Whether to show the Recent Downloads section ("Yes" or "No")
$showRecentDownloads = $configArray['showRecentDownloads'];
# The number of recent downloads to show
$recentdownloads = $configArray['recentdownloads'];
# Whether to show the Sponsored Links section ("Yes" or "No")
$showSponsoredLinks = $configArray['showSponsoredLinks'];
# The number of top downloads to show (Top Downloads module in the left pane).-- these are non paginated, it's best to keep it under 100
$topdownloads = $configArray['topdownloads'];
# The number of sponsored search results to show when a search query is performed.
$sponsoredSearchResults = $configArray['sponsoredSearchResults'];
# The number of pages that you must put through from a site before it automatically gets on your whitelist.
$whitelist_threshold = $configArray['whitelist_threshold'];
# Number of downloads per page
$pagelimit = $configArray['pagelimit'];
# Number of page numbers to display at bottom of listing
$pagenumbers = $configArray['pagenumbers'];
# Maximum numbers of downloads in database (0 for unlimited)
$max_dl = $configArray['max_dl'];
# Maximum numbers of downloads in submitted Queue (0 for unlimited)
$max_que = $configArray['max_que'];
# How the dates shall be displayed (Y = year, m = month, d = date) ex. (24-12-2002)
$date_format = $configArray['date_format'];
# Maximum size of site names
$siteNameLength = $configArray['siteNameLength'];
# The number of times a dead link must be reported before it automatically gets deleted (Only unique IPs can repord dead links).
$deadlink_threshold = $configArray['deadlink_threshold'];
# Whether to automatically put through submissions on the whitelist. ("Yes" or "No").
$auto_allow = $configArray['auto_allow'];
# The maximum number of downloads that can be submitted per day, per site.
$maximumsubmissions = $configArray['maximumsubmissions'];
# Enable Public AutoSubmitter
$publicAutoSubmitter = $configArray['publicAutoSubmitter'];
# Enable AutoResponder
$enableAutoResponder = $configArray['enableAutoResponder'];
# Failed Submit URL Delete Threshold
$failedSubmitURLtries = $configArray['failedSubmitURLtries'];
# Use arrows for provider column
$arrowsForProvider = $configArray['arrowsForProvider'];
# Instant Link variables
# Send you an e-mail everytime someone adds a link? 1=YES, 0=NO
$instantLEnotify = $configArray['instantLEnotify'];
# Maximum number of links
$instantLEmaxLinks = $configArray['instantLEmaxLinks'];
# Use "clean" URLs or redirects? 1=clean, 0=redirects
$instantLEclean = $configArray['instantLEclean'];
# Sorting mechanism for Instant LE links (date, asc, or random)
$instantLEsort = $configArray['instantLEsort'];
# Sorting mechanism for Partner links (date, asc, or random)
$partnerLinksSort = $configArray['partnerLinksSort'];
# The different types of download categories
$categoryQuery = dbcom('SELECT category FROM category WHERE active = 1;');
$categories = array();
while($categoryArray = mysql_fetch_assoc($categoryQuery))
{
$categories[] = $categoryArray['category'];
}
}
getConfig();
class config
{
######################################################################
## DONT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING! ##
######################################################################
var $connect = FALSE;
function option_list()
{
global $categories;
for($i = 0; $i < count($categories); $i++)
{
echo '<option value="' . $categories[$i] . '">' . $categories[$i] . '</option>' . "\n";
}
}
function open()
{
global $votelink;
$this->connect = @mysql_connect(MYSQLHOST, MYSQLUSER, MYSQLPASSWD)
or die("<META http-equiv=\"refresh\" content=\"3; URL=" . $votelink . "\">Failed to connect to database. Stand by...");
@mysql_select_db(MYSQLDB)
or die("<META http-equiv=\"refresh\" content=\"3; URL=" . $votelink . "\">Failed to connect to database. Stand by...");
}
function close()
{
@mysql_close($this->connect);
}
function run($list)
{
$check_first = 1;
for($i = 0; $i < count($list); $i++)
{
if($check_first)
{
$hvahvor = "id = '" . $list[$i] . "'";
$check_first = 0;
}
else
{
$hvahvor .= " || id = '" . $list[$i] . "'";
}
}
return $hvahvor;
}
function paginate($url, $extension = '')
{
global $hovercolor, $pagenumbers, $pagelimit;
if(isset($_GET) && is_array($_GET) && count($_GET) > 0 && array_key_exists('page', $_GET) && ctype_digit($_GET['page']))
{
$page = $_GET['page'];
}
else
{
$page = 1;
}
$currentpage = $page;
if($page != 1)
{
echo '<span class="page"><a href="' . $url . ($currentpage - 1) . $extension . '" title="Go To Previous Page" onmouseover="window.status=\'Go To Page ' . ($currentpage - 1) . '\'; return true;" onmouseout="window.status=\'\'">Previous</a></span>' . "\n";
}
else
{
echo '<span class="page"><a class="selected" title="Go To Previous Page">Previous</a></span>' . "\n";
}
$totalpages = ceil($this->total / $pagelimit);
if($totalpages - $currentpage < $pagenumbers)
{
$pages = $currentpage - ($pagenumbers - ($totalpages - $currentpage));
if($pages <= 0)
{
$pages = 1;
}
else
{
$pagenumbers += $pages;
}
}
else
{
$pages = $currentpage - 5;
if($pages <= 0)
{
$pages = 1;
}
else
{
$pagenumbers += $pages - 1;
}
}
for($pages; $pages <= $totalpages; $pages++)
{
if($pages != $page)
{
echo '<span class="page"><a href="' . $url . $pages . $extension . '" title="Go To Page ' . $pages . '" onmouseover="window.status=\'Go To Page ' . $pages . '\'; return true;" onmouseout="window.status=\'\'">' . $pages . '</a></span>' . "\n";
}
else
{
echo '<span class="page"><a class="selected" title="Currently On Page ' . $pages . '" onmouseover="window.status=\'Currently On Page ' . $pages . '\'; return true;" onmouseout="window.status=\'\'">' . $pages . '</a></span>' . "\n";
$currentpage = $pages;
}
if($pages >= $pagenumbers)
{
break;
}
}
if($page < ($pages - 1))
{
echo '<span class="page"><a href="' . $url . ($currentpage + 1) . $extension . '" title="Go To Next Page" onmouseover="window.status=\'Go To Page ' . ($currentpage + 1) . '\'; return true;" onmouseout="window.status=\'\'">Next</a></span>' . "\n";
}
else
{
echo '<span class="page"><a class="selected" title="Go To Next Page">Next</a></span>' . "\n";
}
}
function blacklist($url) {
$blacklist = mysql_query("SELECT url FROM blacklist");
while ($banned = mysql_fetch_array($blacklist)) {
if (stristr($url, $banned[url])) {
return true;
break;
}
}
}
function spamcheck($title) {
$spamlist = mysql_query("SELECT spamword FROM spamwords");
while ($spam = mysql_fetch_array($spamlist)) {
if (stristr($title, $spam[spamword])) {
return true;
break;
}
}
}
function whitelisted($url) {
$whitelisted = mysql_query("SELECT url FROM whitelist");
while ($clean = mysql_fetch_array($whitelisted)) {
if (stristr($url, $clean[url])) {
return true;
break;
}
}
}
function vip($url)
{
$vipQuery = dbcom('SELECT url FROM whitelist WHERE vip = 1;');
while($vipArray = mysql_fetch_array($vipQuery))
{
if(stristr($url, $vipArray['url']))
{
return TRUE;
break;
}
}
}
function getdomain($url)
{
if(version_compare(PHP_VERSION, '5.1.2', '>=') === TRUE)
{
$hostname = trim(strtolower(parse_url($url, PHP_URL_HOST)));
}
else
{
$URLparts = parse_url($url);
$hostname = trim(strtolower($URLparts['host']));
}
return str_replace('www.', '', $hostname);
}
}
function ShortenText($text)
{
# Change to the number of characters you want to display
$chars = 40;
$text = trim($text);
if(strlen($text) > ($chars - 1))
{
$text = $text . ' ';
$text = substr($text, 0, $chars);
$text = substr($text, 0, strrpos($text, ' '));
return $text . '...';
}
else
{
return $text;
}
}
function Capitalize($title, $delimiter = ' ')
{
/*
Capitalizes the words in a title according to the MLA Handbook.
$delimiter parameter is optional. It is only needed if delimiter
is not a space.
*/
$articles = 'a|an|the';
$prepositions = 'aboard|above|according|across|against|along|around|as|at|because|before|below|beneath|beside|between|beyond|by|concerning|during|except|for|from|inside|into|like|near|next|of|off|on|out|outside|over|past|since|through|to|toward|underneath|until|upon|with';
$conjunctions = 'and|but|nor|or|so|yet';
$verbs = 'are|be|did|do|is|was|were|will';
$exceptions = explode('|', $articles . '|' . $prepositions . '|' . $conjunctions . '|' . $verbs);
$words = explode($delimiter, $title);
# first & last words are always capitalized
$lastWord = count($words) - 1;
$words[0] = ucfirst($words[0]);
$words[$lastWord] = ucfirst($words[$lastWord]);
for($i = 1; $i < $lastWord; $i++)
{
if(!in_array($words[$i], $exceptions))
{
$words[$i] = ucfirst($words[$i]);
}
}
$newTitle = implode(' ', $words);
return $newTitle;
}
function getsuffix()
{
# get a suffix from a list stored in db table called 'suffixes'
$aResult = dbcom('SELECT suffix FROM suffixes ORDER BY RAND() LIMIT 1;');
$aRow = mysql_fetch_array($aResult, MYSQL_ASSOC);
return $aRow['suffix'];
}
?>