|
From: OryNider <ory...@us...> - 2007-06-06 22:24:43
|
Update of /cvsroot/mxbb/mx_phpCA In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3371 Added Files: adverts.php db_install.php db_uninstall.php db_upgrade.php index.html mx_phpCA.pak readme.txt Log Message: --- NEW FILE: index.html --- <html> <head> <title>Mx phpCA - Classified Ads Module</title> </head> <body> <br /><br /><br /><br /><br /><br /><br /> <center><h1><a href="http://mxbb.net/">mxBB-Portal</a></h1></center> </body> --- NEW FILE: db_uninstall.php --- <?php /** * * @package mxBB Portal Module - mx_phpCA * @version $Id: db_uninstall.php,v 1.1 2007/06/06 22:24:36 orynider Exp $ * @copyright (c) 2004-2006, amo, am...@ho... * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define('IN_PORTAL', true); if ( !defined('IN_ADMIN') ) { $mx_root_path = '../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($mx_root_path . 'common.'.$phpEx); // // Start session management // $mx_user->init($user_ip, PAGE_INDEX); if( !$userdata['session_logged_in'] ) { die("Hacking attempt(3)"); } if( $userdata['user_level'] != ADMIN ) { die("Hacking attempt(4)"); } // // End session management // } $sql = array( "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_adverts", "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_categories", "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_chasers", "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_comments", "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_config", "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_details", "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_images", "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_paid_ads_config", "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_rate", "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_users", "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_paypal_payments" ); $n = 0; $message = "<b>This list is a result of the SQL queries needed to uninstall <i> - phpCA Classified Ads</i> Module Addon</b><br/><br/>"; while($sql[$n]) { $message .= ($mods[$n-1] != $mods[$n]) ? '<p><b><font size=3>'.$mods[$n].'</font></b><br/>' : ''; if( !$result = $db->sql_query($sql[$n]) ) { $message .= '<b><font color=#FF0000>[Error or Already removed]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />'; } else { $message .='<b><font color=#0000fF>[Removed]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />'; } $n++; } $message .= ' <br />If you get some Error, relax, this is normal when updating modules'; echo '<br /> <br />'; echo '<table cellpadding="4" cellspacing="1" border="0" class="forumline">'; echo '<tr><th class="thHead" align="center">Module Installation Information</th></tr>'; echo '<tr><td class="row1" align="center"><span class="gen">' . $message . '</span></td></tr>'; echo '</table> <br />'; ?> --- NEW FILE: db_upgrade.php --- <?php /** * * @package mxBB Portal Module - mx_phpCA * @version $Id: db_upgrade.php,v 1.1 2007/06/06 22:24:37 orynider Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $mx_user->init($user_ip, PAGE_INDEX); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } $mx_module_version = '1.0.1'; $mx_module_copy = 'mxBB <i> - phpCA Classified Ads</i> module by PeteMan & <a href="http://www.mxbb.net" target="_blank">OryNider</a>'; $sql = array(); if ( $result = $db->sql_query( "SELECT config_name from " . $mx_table_prefix . "ads_config" ) ) { // // Upgrade checks // $upgrade_101 = 0; // // validate before 2.00 // $result1 = $db->sql_query( "SELECT ebay_id from " . $mx_table_prefix . "ads_adverts" ); $result2 = $db->sql_query( "SELECT config_value from " . $mx_table_prefix . "ads_config WHERE config_name = 'ebay_ref'" ); if ( $db->sql_numrows( $result1 ) == 0 ) { $upgrade_101 = 1; } elseif ( $db->sql_numrows( $result2 ) == 0 ) { $upgrade_101 = 1; } $message = "<b>Upgrading!</b><br/><br/>"; if ( $upgrade_101 == 1 ) { $message .= "<b>Upgrading to v. 1.0.1 ...</b><br/><br/>"; $sql[] = "ALTER TABLE ".$mx_table_prefix."ads_adverts ADD ebay_id varchar(12) NOT NULL DEFAULT '0' AFTER trade_ind"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('ebay_ref', '172425')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('webmasterplan_site', '1382')"; } else { $message .= "<b>Nothing to upgrade...</b><br/><br/>"; } $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; $message .= mx_do_install_upgrade( $sql ); } else { // // If not installed // $message = "<b>Module is not installed...and thus cannot be upgraded ;)</b><br/><br/>"; } echo "<br /><br />"; echo "<table width=\"90%\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\" class=\"forumline\">"; echo "<tr><th class=\"thHead\" align=\"center\">Module Installation/Upgrading/Uninstalling Information - module specific db tables</th></tr>"; echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . $message . "</span></td></tr>"; echo "</table><br />"; ?> --- NEW FILE: adverts.php --- <? /** * * @package mxBB Portal Module - mx_phpCA * @version $Id: adverts.php,v 1.1 2007/06/06 22:24:35 orynider Exp $ * @copyright (c) 2006 [su...@ph..., Peter Mansion] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ // // ERROR HANDLING // //error_reporting( E_ALL ); if( !defined('IN_PORTAL') || !is_object($mx_block)) { define('IN_PORTAL', true); $mx_root_path = '../../'; // // Let's include some stuff... // $phpEx = substr(strrchr(__FILE__, '.'), 1); include_once($mx_root_path . 'common.' . $phpEx); // // Start session management // $mx_user->init($user_ip, PAGE_INDEX); // // End session management // $block_id = ( !empty($HTTP_GET_VARS['block_id']) ) ? $HTTP_GET_VARS['block_id'] : $HTTP_POST_VARS['id']; if( empty($block_id) ) { $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'phpCA Ads' LIMIT 1"; if(!$result = $db->sql_query($sql)) { mx_message_die(GENERAL_ERROR, "Could not query phpCA Ads module block information", "", __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $block_id = $row['block_id']; } $is_block = FALSE; global $images, $mx_images, $postrow; } else { // // Read block Configuration // $title = $mx_block->block_info['block_title']; $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '100%' ); if( is_object($mx_block)) { $is_block = TRUE; } global $images, $mx_images, $postrow; } $ads_root_path = $module_root_path . 'ads_mod/'; include_once($ads_root_path . 'ads_common.'.$phpEx); // //mode // if ( isset($HTTP_POST_VARS['ads_mode']) || isset($HTTP_GET_VARS['ads_mode']) ) { $mode= ( isset($HTTP_POST_VARS['ads_mode']) ) ? $HTTP_POST_VARS['ads_mode'] : $HTTP_GET_VARS['ads_mode']; } else { $mode= 'ads_index'; } if ( $mode == 'ads_comment' ) { include($module_root_path. 'includes/ads_comment.'.$phpEx); } else if ( $mode == 'ads_comment_delete' ) { include($module_root_path. 'includes/ads_comment_delete.'.$phpEx); } else if ( $mode == 'ads_comment_edit' ) { include($module_root_path. 'includes/ads_comment_edit.'.$phpEx); } else if ( $mode == 'ads_comment_temp' ) { include($module_root_path. 'includes/ads_comment_temp.'.$phpEx); } else if ( $mode == 'ads_create' ) { include($module_root_path. 'includes/ads_create.'.$phpEx); } else if ( $mode == 'ads_images' ) { include($module_root_path. 'includes/ads_images.'.$phpEx); } else if ( $mode == 'ads_item' ) { include($module_root_path. 'includes/ads_item.'.$phpEx); } else if ( $mode == 'ads_item_delete' ) { include($module_root_path. 'includes/ads_item_delete.'.$phpEx); } else if ( $mode == 'ads_item_edit' ) { include($module_root_path. 'includes/ads_item_edit.'.$phpEx); } else if ( $mode == 'ads_item_renewal' ) { include($module_root_path. 'includes/ads_item_renewal.'.$phpEx); } else if ( $mode == 'ads_item_status' ) { include($module_root_path. 'includes/ads_item_status.'.$phpEx); } else if ( $mode == 'ads_search' ) { include($module_root_path. 'includes/ads_search.'.$phpEx); } else if ( $mode == 'ads_popup' ) { include($module_root_path. 'includes/ads_popup.'.$phpEx); } else if ( $mode == 'ads_prices' ) { include($module_root_path. 'includes/ads_prices.'.$phpEx); } else if ( $mode == 'ads_rss2' ) { include($module_root_path. 'includes/ads_rss2.'.$phpEx); } else if( !is_object($mx_block)) { die("Hacking attempt"); } else if ( $mode == 'ads_index' ) { // Check the permissions if ( view_allowed($ads_config['view_level']) == FALSE ) { if ( !$userdata['session_logged_in'] ) { mx_redirect(append_sid($mx_root_path . "login.php?redirect=" . this_mo_loginurl(), true)); } else { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } // If admin send renewal chasers if ( $userdata['user_level'] == ADMIN ) { $filename = ADS_CHASERS_PATH . date("dMy").'.txt'; if ( !file_exists($filename) ) { include($ads_root_path . 'ads_renewal_mailer.'.$phpEx); } } // Sanitize input data if ( isset($HTTP_GET_VARS['category']) ) { $inp_category = htmlspecialchars($HTTP_GET_VARS['category']); } else { $inp_category = ''; } if ( isset($HTTP_GET_VARS['sub_category']) ) { $inp_sub_category = htmlspecialchars($HTTP_GET_VARS['sub_category']); } else { $inp_sub_category = ''; } // Extra sanitize for SQL variables $inp_category = str_replace("\'", "''", $inp_category); $inp_sub_category = str_replace("\'", "''", $inp_sub_category); $current_time = time(); $page_title = $lang['ads_index']; if ( !is_object($mx_block)) { include($mx_root_path . 'includes/page_header.'.$phpEx); } $template->set_filenames(array('adverts_page' => 'adverts.tpl')); // SQL for adverts table $sql = "SELECT category, sub_category, COUNT(sub_category) AS number FROM ". ADS_ADVERTS_TABLE ." WHERE expiry_date > $current_time GROUP BY category, sub_category"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $sub_category_ar[$row['category'].'_'.$row['sub_category']] = $row['number']; } $sql = 'SELECT * FROM '. ADS_CATEGORIES_TABLE .' ORDER BY cat_category, cat_sub_category ASC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $category = $row['cat_category']; $sub_category = $row['cat_sub_category']; // Encode the fields $u_category = urlencode(stripslashes(htmlspecialchars_decode_php4(str_replace("''", "\'", $category)))); $u_sub_category = urlencode(stripslashes(htmlspecialchars_decode_php4(str_replace("''", "\'", $sub_category)))); if ( empty($save_category) ) { $save_category = ''; } if ( $save_category != $category ) { $category_url = append_sid(this_ads_mxurl("ads_mode=ads_index&category=$u_category")); $cat_img = $mx_images['forum']; $template->assign_block_vars('categoryrow', array( 'CAT_IMG' => $cat_img, 'CATEGORY' => "<b><a href='$category_url'>$category</a></b><br>" )); $save_category = $category; } $sub_category_temp = "<a href='".append_sid(this_ads_mxurl("ads_mode=ads_index&category=$u_category&sub_category=$u_sub_category"))."'>$sub_category</a>"; $sub_category_img = $mx_images['folder']; if ( !empty($sub_category_ar[$save_category.'_'.$sub_category]) ) { $sub_category_temp .= ' ('.$sub_category_ar[$save_category.'_'.$sub_category].')'; } $template->assign_block_vars('categoryrow', array( 'CAT_IMG' => $sub_category_img, 'CATEGORY' => $sub_category_temp )); } /* while ($row = $db->sql_fetchrow($result)) { $category = $row['cat_category']; $sub_category = $row['cat_sub_category']; // Encode the fields $u_category = urlencode(stripslashes(htmlspecialchars_decode_php4(str_replace("''", "\'", $category)))); $u_sub_category = urlencode(stripslashes(htmlspecialchars_decode_php4(str_replace("''", "\'", $sub_category)))); if ( $category != $save_category ) { $category_url = append_sid("adverts.$phpEx?category=$u_category"); $template->assign_block_vars('categoryrow', array('CATEGORY' => "<b><a href='$category_url'>$category</a></b><br>")); $save_category = $category; } $sub_category_temp = "<a href='".append_sid("adverts.$phpEx?category=$u_category&sub_category=$u_sub_category")."'>$sub_category</a>"; if ( $sub_category_ar[$save_category.'_'.$sub_category] ) { $sub_category_temp .= ' ('.$sub_category_ar[$save_category.'_'.$sub_category].')'; } $template->assign_block_vars('categoryrow', array('CATEGORY' => $sub_category_temp)); } */ // Set the start page if( isset($_GET['start']) ) { $start = intval($_GET['start']); } else { $start = 0; } // Get the total number of ads if ( !empty($inp_category) && !empty($inp_sub_category) ) { $sql = "SELECT * FROM ". ADS_ADVERTS_TABLE ." WHERE expiry_date > $current_time AND category = '$inp_category' AND sub_category = '$inp_sub_category'"; } else if ( !empty($inp_category) ) { $sql = "SELECT * FROM ". ADS_ADVERTS_TABLE ." WHERE expiry_date > $current_time AND category = '$inp_category'";} else { $sql = "SELECT * FROM ". ADS_ADVERTS_TABLE ." WHERE expiry_date > $current_time"; } $result = $db->sql_query($sql); $ads_count = $db->sql_numrows($result); // Get the ads for this page if ( $inp_category and $inp_sub_category ) { $sql = "SELECT * FROM ". ADS_ADVERTS_TABLE ." WHERE category = '$inp_category' AND sub_category = '$inp_sub_category' AND expiry_date > $current_time ORDER BY premium_ad_ind DESC, id DESC LIMIT ".$start.", ".$ads_config['ads_per_page']; } else if ( $inp_category ) { $sql = "SELECT * FROM ". ADS_ADVERTS_TABLE ." WHERE category = '$inp_category' AND expiry_date > $current_time ORDER BY premium_ad_ind DESC, id DESC LIMIT ".$start.", ".$ads_config['ads_per_page']; } else { $sql = "SELECT * FROM ". ADS_ADVERTS_TABLE ." WHERE expiry_date > $current_time ORDER BY premium_ad_ind DESC, id DESC LIMIT ".$start.", ".$ads_config['ads_per_page']; } $result = $db->sql_query($sql); if ( $db->sql_numrows($result) > 0 ) { while ($row = $db->sql_fetchrow($result)) { $id = $row['id']; $user_id = $row['user_id']; $ebay_id = $row['ebay_id']; $profiledata = get_userdata($user_id); if ( $user_id != ANONYMOUS ) { $profile = append_sid($phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"); } else { $profile = ''; } if ( $row['status'] == 'sold' ) { $status = $lang['sold']; } elseif ( $row['status'] == 'expired' ) { $status = $lang['expired']; } elseif ( $row['status'] == 'active' ) { $status = $lang['active']; } if ( $row['ad_type_code'] == '4' ) { $premium_ad = '<b>['.$lang['premium_ad'].']</b><br>'; } else { $premium_ad = ''; } // Count the comments $sql2 = "SELECT COUNT(comment_id) AS comments_count FROM ". ADS_COMMENTS_TABLE ." WHERE comment_ad_id = '$id' GROUP BY comment_ad_id LIMIT 1"; $result2 = $db->sql_query($sql2); $row2 = $db->sql_fetchrow($result2); if ( empty($row2) ) { $total_comments = 0; } else { $total_comments = $row2['comments_count']; } // Check to see if an image exists for this ad if ( $ads_config['images'] == 1 ) { $sql2 = "SELECT * FROM ". ADS_IMAGES_TABLE ." WHERE id = '$id' AND img_deleted_ind = 0 LIMIT 0,1"; //global $ebay_id, $mx_images; $sql3 = "SELECT * FROM ". ADS_ADVERTS_TABLE ." WHERE ebay_id = '$ebay_id' LIMIT ".$start.", ".$ads_config['ads_per_page']; $result2 = $db->sql_query($sql2); $result3 = $db->sql_query($sql3); if ( $db->sql_numrows($result2) > 0 ) { while ($row2 = $db->sql_fetchrow($result2)) { $img_url = ADS_IMAGES_PATH ."ad".$id."_img".$row2["img_seq_no"]."_thumb.jpg"; } } elseif ( $db->sql_numrows($result3) > 0 ) { while ($row3 = $db->sql_fetchrow($result3)) { $ebay_id = $row3['ebay_id']; $img_url = 'http://thumbs.ebaystatic.com/pict/' . $ebay_id . '.jpg'; if ($ebay_id == '0') { $img_url = $mx_images['noimage']; } } } $template->assign_block_vars('imagerow', array( 'U_ADS_ITEM' => append_sid(this_ads_mxurl("ads_mode=ads_item&id=".$row['id'])), 'U_PROFILE' => $profile, 'USERNAME' => $profiledata['username'], 'TITLE' => $row['title'], 'SHORT_DESC' => $premium_ad.nl2br($row['short_desc']), 'DATE_ADDED' => date($lang['DATE_FORMAT'],$row['time']), 'STATUS' => $status, 'EBAY_ID' => $row['ebay_id'], 'PRICE' => $row['price'], 'VIEWS' => $row['views'], 'COMMENTS' => $total_comments, 'IMAGE' => ( !empty($img_url) ? $img_url : $mx_images['noimage'] ) )); } else { $template->assign_block_vars('noimagerow', array( 'U_ADS_ITEM' => append_sid(this_ads_mxurl("ads_mode=ads_item&id=".$row['id'])), 'U_PROFILE' => $profile, 'USERNAME' => $profiledata['username'], 'TITLE' => $premium_ad.$row['title'], 'SHORT_DESC' => nl2br($row['short_desc']), 'DATE_ADDED' => date($lang['DATE_FORMAT'],$row['time']), 'STATUS' => $status, 'PRICE' => $row['price'], 'VIEWS' => $row['views'], 'COMMENTS' => $total_comments)); } } } else { $template->assign_block_vars('switch_no_items_found',array()); } if ( $ads_config['images'] == 1 ) { $template->assign_block_vars('switch_images_enabled',array()); } if ( $inp_category ) { $pointer= ' -> '; } else { $pointer= ''; } if ( $inp_sub_category ) { $pointer2 = ' -> '; } else { $pointer2 = ''; } if ( $ads_count == 0 ) { $ads_count = 1; } // Encode the fields $u_category = urlencode(stripslashes(htmlspecialchars_decode_php4(str_replace("''", "\'", $inp_category)))); $u_sub_category = urlencode(stripslashes(htmlspecialchars_decode_php4(str_replace("''", "\'", $inp_sub_category)))); $goto_string = generate_pagination(this_ads_mxurl("ads_mode=ads_index&category=" . $u_category . "&sub_category=" . $u_sub_category), $ads_count, $ads_config['ads_per_page'], $start); $page_string = sprintf($lang['Page_of'], ( floor( $start / $ads_config['ads_per_page'] ) + 1 ), ceil( $ads_count / $ads_config['ads_per_page'] )); $template->assign_vars(array( 'U_ADS_INDEX' => append_sid(this_ads_mxurl()), 'L_ADS_INDEX' => $lang['ads_index'], 'U_CREATE_AD' => append_sid(this_ads_mxurl("ads_mode=ads_create")), 'U_CATEGORY' => append_sid(this_ads_mxurl("ads_mode=ads_index&category=" . $u_category)), 'U_SUB_CATEGORY' => append_sid(this_ads_mxurl("ads_mode=ads_index&category=" . $u_category . "&sub_category=" . $u_sub_category)), 'U_RSS2' => append_sid($module_root_path . "adverts." . $phpEx . "?ads_mode=ads_rss2" . '&sid=' . $userdata['session_id']), 'IMG_RSS2' => $mx_images['ads_rss2'], 'L_CATEGORIES' => $lang['categories'], 'L_TITLE' => $lang['title'], 'L_SHORT_DESC' => $lang['short_desc'], 'L_DATE_ADDED' => $lang['date_added'], 'L_AD_STATUS' => $lang['ad_status'], 'L_PRICE' => $lang['price'], 'L_USERNAME' => $lang['username'], 'L_IMAGE' => $lang['image'], 'L_STATS' => $lang['stats'], 'L_VIEWS' => $lang['views'], 'L_COMMENTS' => $lang['comments'], 'L_NO_ITEMS_FOUND' => $lang['no_items_found'], 'SITE_NAME' => $board_config['sitename'], 'MSG_NEWAD' => $mx_images['msg_newad'], 'GOTO_STRING' => $goto_string, 'PAGE_STRING' => $page_string, 'POINTER' => $pointer, 'POINTER2' => $pointer2, 'CATEGORY' => stripslashes(str_replace("''", "\'", $inp_category)), 'SUB_CATEGORY' => stripslashes(str_replace("''", "\'", $inp_sub_category)))); $template->pparse('adverts_page'); if ( !is_object($mx_block)) { include($mx_root_path . 'includes/page_tail.'.$phpEx); } // +-------------------------------------------------------------+ // | Powered by phpCA Classified Ads 0.5.6 (c) 2006 PeteMan | // +-------------------------------------------------------------+ } ?> --- NEW FILE: db_install.php --- <?php /** * * @package mxBB Portal Module - mx_phpCA * @version $Id: db_install.php,v 1.1 2007/06/06 22:24:36 orynider Exp $ * @copyright (c) 2004-2006, amo, am...@ho... * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $mx_user->init($user_ip, PAGE_INDEX); // End session management if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } } $mx_module_version = '1.0.1'; $mx_module_copy = 'mxBB <i> - phpCA Classified Ads</i> module by PeteMan & <a href="http://www.mxbb.net" target="_blank">OryNider</a>'; // If fresh install if ( !$result = $db->sql_query( "SELECT config_name from " . $mx_table_prefix . "ads_config" ) ) { $message = "<b>This is a fresh install!</b><br/><br/>"; $sql = array(); $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_adverts"; $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_categories"; $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_chasers"; $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_comments"; $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_config"; $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_details"; $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_images"; $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_paid_ads_config"; $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_rate"; $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_users"; $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "ads_paypal_payments"; $sql[] = "CREATE TABLE ".$mx_table_prefix."ads_adverts ( id int(11) NOT NULL AUTO_INCREMENT, category varchar(25) NOT NULL DEFAULT '', sub_category varchar(25) NOT NULL DEFAULT '', ad_type_code smallint(1) NOT NULL DEFAULT '0', basic_ad_ind tinyint(1) NOT NULL DEFAULT '0', standard_ad_ind tinyint(1) NOT NULL DEFAULT '0', photo_ad_ind tinyint(1) NOT NULL DEFAULT '0', premium_ad_ind tinyint(1) NOT NULL DEFAULT '0', ad_cost decimal(10, 2) NOT NULL default '0.00', user_id mediumint(8) NOT NULL DEFAULT '0', username varchar(32) DEFAULT NULL, user_ip varchar(8) NOT NULL DEFAULT '', time int(11) unsigned NOT NULL DEFAULT '0', edit_user_id mediumint(8) DEFAULT NULL, edit_time int(11) unsigned NOT NULL DEFAULT '0', edit_count smallint(5) unsigned NOT NULL DEFAULT '0', title varchar(50) NOT NULL DEFAULT '', short_desc varchar(125) NOT NULL DEFAULT '', price varchar(50) NOT NULL DEFAULT '0', views int(11) NOT NULL DEFAULT '0', status varchar(7) NOT NULL DEFAULT '', expiry_date int(11) unsigned NOT NULL DEFAULT '0', trade_ind tinyint(1) NOT NULL DEFAULT '0', ebay_id varchar(12) NOT NULL DEFAULT '0', PRIMARY KEY (id) ) TYPE=MyISAM"; $sql[] = "CREATE TABLE ".$mx_table_prefix."ads_categories ( cat_category varchar(40) NOT NULL default '', cat_sub_category varchar(40) NOT NULL default '', cat_basic_cost smallint(6) NOT NULL default '0', cat_standard_cost smallint(6) NOT NULL default '0', cat_photo_cost smallint(6) NOT NULL default '0', cat_premium_cost smallint(6) NOT NULL default '0', cat_field_1_desc varchar(50) NOT NULL default '', cat_field_2_desc varchar(50) NOT NULL default '', cat_field_3_desc varchar(50) NOT NULL default '', cat_field_4_desc varchar(50) NOT NULL default '', cat_field_5_desc varchar(50) NOT NULL default '', cat_field_6_desc varchar(50) NOT NULL default '', cat_field_7_desc varchar(50) NOT NULL default '', cat_field_8_desc varchar(50) NOT NULL default '', cat_field_9_desc varchar(50) NOT NULL default '', cat_field_10_desc varchar(50) NOT NULL default '', cat_create_level tinyint(3) NOT NULL default '0', cat_edit_level tinyint(3) NOT NULL default '0', cat_delete_level tinyint(3) NOT NULL default '0', cat_image_level tinyint(3) NOT NULL default '0', cat_comment_level tinyint(3) NOT NULL default '0', cat_rate_level tinyint(3) NOT NULL default '0', PRIMARY KEY (cat_category, cat_sub_category) ) TYPE=MyISAM"; $sql[] = "CREATE TABLE ".$mx_table_prefix."ads_chasers ( id int(11) NOT NULL default '0', last_chase_type char(1) NOT NULL default '', renewal_password int(9) NOT NULL default '0', PRIMARY KEY (id) ) TYPE=MyISAM"; $sql[] = "CREATE TABLE ".$mx_table_prefix."ads_comments ( comment_id int(11) unsigned NOT NULL AUTO_INCREMENT, comment_ad_id int(11) unsigned NOT NULL default '0', comment_user_id mediumint(8) NOT NULL default '0', comment_username varchar(32) default NULL, comment_user_ip varchar(8) NOT NULL default '', comment_time int(11) unsigned NOT NULL default '0', comment_text text, comment_edit_time int(11) unsigned default NULL , comment_edit_count smallint(5) unsigned NOT NULL default '0', comment_edit_user_id mediumint(8) default NULL, PRIMARY KEY (comment_id), KEY comment_ad_id (comment_ad_id), KEY comment_user_id (comment_user_id), KEY comment_user_ip (comment_user_ip), KEY comment_time (comment_time) ) TYPE=MyISAM"; $sql[] = "CREATE TABLE " . $mx_table_prefix . "ads_config ( config_name VARCHAR(255) NOT NULL default '', config_value varchar(255) NOT NULL default '', PRIMARY KEY (config_name) ) TYPE=MyISAM"; $sql[] = "CREATE TABLE ".$mx_table_prefix."ads_details ( id int(11) NOT NULL default '0', additional_info text NOT NULL , field_1 varchar(100) NOT NULL default '', field_2 varchar(100) NOT NULL default '', field_3 varchar(100) NOT NULL default '', field_4 varchar(100) NOT NULL default '', field_5 varchar(100) NOT NULL default '', field_6 varchar(100) NOT NULL default '', field_7 varchar(100) NOT NULL default '', field_8 varchar(100) NOT NULL default '', field_9 varchar(100) NOT NULL default '', field_10 varchar(100) NOT NULL default '', PRIMARY KEY (id) ) TYPE=MyISAM"; $sql[] = "CREATE TABLE ".$mx_table_prefix."ads_images ( id int(11) NOT NULL default '0', img_seq_no int(11) NOT NULL AUTO_INCREMENT, img_description text NOT NULL, img_deleted_ind tinyint(1) NOT NULL default '0', PRIMARY KEY (id, img_seq_no) ) TYPE=MyISAM"; $sql[] = "CREATE TABLE " . $mx_table_prefix . "ads_paid_ads_config ( config_name VARCHAR(255) NOT NULL default '', config_value varchar(255) NOT NULL default '', PRIMARY KEY (config_name) ) TYPE=MyISAM"; $sql[] = "CREATE TABLE ".$mx_table_prefix."ads_rate ( rate_ad_id int(11) unsigned NOT NULL default '0', rate_user_id mediumint(8) NOT NULL default '0', rate_user_ip char(8) NOT NULL default '', rate_point tinyint(3) unsigned NOT NULL default '0', KEY rate_ad_id (rate_ad_id), KEY rate_user_id (rate_user_id), KEY rate_user_ip (rate_user_ip), KEY rate_point (rate_point) ) TYPE=MyISAM"; $sql[] = "CREATE TABLE ".$mx_table_prefix."ads_users ( users_user_id mediumint(8) NOT NULL default '0', users_time int(11) NOT NULL default '0', users_edit_time int(11) NOT NULL default '0', users_balance smallint(6) NOT NULL default '0', PRIMARY KEY (users_user_id) ) TYPE=MyISAM"; $sql[] = "CREATE TABLE ".$mx_table_prefix."ads_paypal_payments ( invoice INT UNSIGNED AUTO_INCREMENT, receiver_email varchar(60), item_name varchar(100), item_number varchar(10), quantity varchar(6), payment_status varchar(10), pending_reason varchar(10), payment_date varchar(20), mc_gross varchar(20), mc_fee varchar(20), tax varchar(20), mc_currency varchar(3), txn_id varchar(20), txn_type varchar(10), first_name varchar(30), last_name varchar(40), address_street varchar(50), address_city varchar(30), address_state varchar(30), address_zip varchar(20), address_country varchar(30), address_status varchar(10), payer_email varchar(60), payer_status varchar(10), payment_type varchar(10), notify_version varchar(10), verify_sign varchar(10), custom mediumint(8), PRIMARY KEY (invoice) ) TYPE=MyISAM"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('max_pics', '1024')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('ads_per_page', '5')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('ad_duration_months', '3')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('board_disable', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('config_id', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('default_style', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('first_chase_days', '28')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('large_img_height', '480')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('large_img_width', '640')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('max_ads_per_user', '100')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('max_images_per_ad', '5')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('medium_img_height', '200')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('medium_img_width', '200')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('second_chase_days', '14')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('thumb_img_height', '100')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('thumb_img_width', '100')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('rate_scale', '10')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('comment', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('rate', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('images', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('paid_ads', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('renewals', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('view_level', '-1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('move_level', '2')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('search_level', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('private_trade_ind', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('version', '0.5.5')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('enable_integration', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('override_default_pages', '0')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('index', '6')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('ebay_ref', '172425')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_config VALUES ('webmasterplan_site', '1382')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_paid_ads_config VALUES ('currency_code', 'GBP')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_paid_ads_config VALUES ('language_code', 'GB')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_paid_ads_config VALUES ('business_email', 'web...@ho...')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_paid_ads_config VALUES ('sandbox', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_paid_ads_config VALUES ('basic', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_paid_ads_config VALUES ('standard', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_paid_ads_config VALUES ('photo', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "ads_paid_ads_config VALUES ('premium', '1')"; $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; $message .= mx_do_install_upgrade( $sql ); } else { // If already installed $message = "<b>Module is already installed... consider upgrading ;)</b><br/><br/>"; } echo "<br /><br />"; echo "<table width=\"90%\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\" class=\"forumline\">"; echo "<tr><th class=\"thHead\" align=\"center\">Module Installation/Upgrading/Uninstallation Information - Module specific DB tables</th></tr>"; echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . $message . "</span></td></tr>"; echo "</table><br />"; ?> --- NEW FILE: mx_phpCA.pak --- module=+:86=+:phpCA Classified Ads=+:modules/mx_phpCA/=+:mx_phpCA=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:86=+:87=+:phpCA Ads=+:phpCA Classified Ads block=+:adverts.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:phpCA Ads=+:Demo block=+:87=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 --- NEW FILE: readme.txt --- /********************************************************************************\ | | subject : mxBB-Portal, CMS & portal, module | name : mx_phpCA | begin : January, 2007 | copyright : (C) 2002-2007 mxBB | mxBB project site : www.mx-system.com | | author : OryNider (see additional credit below) | author site : http://pubory.uv.ro/ | author email : ory...@rd... | | additional credit : This module is based on the phpCA Classified Ads MOD | created by PeteMan (Peter Mansion) | < su...@ph... > | http://www.phpca.net | | additional credit : | | | | | description : phpBB-based Classified Ads System. | |********************************************************************************| | | @package mxBB Portal Module - mx_phpCA | @version $Id: readme.txt,v 1.1 2007/06/06 22:24:38 orynider Exp $ | @copyright (c) 2002-2007 [OryNider] mxBB Development Team | @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 | \********************************************************************************/ /********************************************************************************\ | Installation Instructions \********************************************************************************/ Note: In order for this module to install you must have a working phpBB and mxBB installation. 1) Copy the folder: mx_phpCA into your: {mxBB install}\modules\ folder on your web server. 2) From your website enter mxBB Admin Control Panel. 3) Under mxBB-Portal click on Management. 4) Now click on Modules Setup. 5) Under Module Administration use the pull down menu and choose: mx_phpCA 6) Press the Install Module button 7) If you have followed the instructions correctly you should now be able to create phpCA Ads blocks for inclusion on your pages. 8) chmod 777 upload/chasers/, upload/images/ and upload/payments/ /********************************************************************************\ | End Of Document \********************************************************************************/ |