function getPDFPrefs() { global $sql, $eArrayStorage; if (!is_object($sql)) { $sql = new db(); } $num_rows = $sql->db_Select("core", "*", "e107_name='pdf' "); if ($num_rows == 0) { $tmp = getDefaultPDFPrefs(); $tmp2 = $eArrayStorage->WriteArray($tmp); $sql->db_Insert("core", "'pdf', '" . $tmp2 . "' "); $sql->db_Select("core", "*", "e107_name='pdf' "); } $row = $sql->db_Fetch(); $pdfpref = $eArrayStorage->ReadArray($row['e107_value']); return $pdfpref; }
function roster_show() { global $sql, $sql2; // make the groups $groups_q = $sql->db_Select("roster_groups", "*", "roster_group_id!='0' ORDER BY roster_group_order ASC"); $tables = ""; while ($row = $sql->db_Fetch(MYSQL_ASSOC)) { $tables .= "<table class=\"roster\" width=\"100%\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"roster_main\" colspan=\"6\">{$row['roster_group_name']}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"roster_header\" width=\"40%\">" . roster_LAN_ROSTER_NAME . "</td>\n\t\t\t\t\t\t<td class=\"roster_header\" width=\"25%\">" . roster_LAN_ROSTER_UASSIGN . "</td>\n\t\t\t\t\t\t<td class=\"roster_header\" width=\"20%\">" . roster_LAN_ROSTER_SERIAL . "</td>\n\t\t\t\t\t\t<td class=\"roster_header\" width=\"15%\">" . roster_LAN_ROSTER_STATUS . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t"; $sql3 = new db(); // get the members in this group $members_q = $sql2->db_Select("roster_members", "*", "roster_member_group='" . $row['roster_group_id'] . "' ORDER BY roster_member_ranknum ASC, roster_member_rankdate ASC, roster_member_name ASC"); while ($row2 = $sql2->db_Fetch(MYSQL_ASSOC)) { if ($row2['roster_member_status'] == "Retired") { $status = "<font color=\"#ff0000\">Retired</font>"; } else { if ($row2['roster_member_status'] == "Reserve") { $status = "<font color=\"#d9c30a\">Reserve</font>"; } else { if ($row2['roster_member_status'] == "On Leave") { $status = "<font color=\"#ff9c00\">On Leave</font>"; } else { $status = "<font color=\"#48E702\">Active Duty</font>"; } } } $i++; $rank = explode(",", $row2['roster_member_rank']); $site_name = $rank[2] . "-" . $row2['roster_member_name']; $info_q = $sql3->db_Select("user", "*", "user_name='" . $site_name . "'"); $info_a = $sql3->db_Fetch(MYSQL_ASSOC); $pm = "<a href=\"" . e_PLUGIN . "pm/pm.php?send." . $info_a['user_id'] . "\"><img src=\"" . e_THEME . "AA/forum/pm.png\" border=\"0\" /></a>"; if ($i % 2 == 0) { $tables .= "<tr>\n\t\t\t\t\t\t\t<td class=\"roster_row1\"><a href=\"userinfo.php?m_id={$row1['roster_member_id']}\">{$rank[0]} {$row1['roster_member_name']}</a></td>\n\t\t\t\t\t\t\t<td class=\"roster_row1\">{$row1['roster_member_unit']}</td>\n\t\t\t\t\t\t\t<td class=\"roster_row1\">{$row1['roster_member_serial']}</div></td>\n\t\t\t\t\t\t\t<td class=\"roster_row1\"><div align=\"center\">{$status}</div></td>\n\t\t\t\t\t\t</tr>"; } else { $tables .= "<tr>\n\t\t\t\t\t\t\t<td class=\"roster_row2\"><a href=\"userinfo.php?m_id={$row2['roster_member_id']}\">{$rank[0]} {$row2['roster_member_name']}</a></td>\n\t\t\t\t\t\t\t<td class=\"roster_row2\">{$row2['roster_member_unit']}</td>\n\t\t\t\t\t\t\t<td class=\"roster_row2\">{$row2['roster_member_serial']}</td>\n\t\t\t\t\t\t\t<td class=\"roster_row2\"><div align=\"center\">{$status}</div></td>\n\t\t\t\t\t\t</tr>"; } } $tables .= "</table><br /><br />"; } return $tables; }
function getPDFPrefs() { global $sql, $eArrayStorage; if (!is_object($eArrayStorage)) { e107_require_once(e_HANDLER . 'arraystorage_class.php'); $eArrayStorage = new ArrayData(); } if (!is_object($sql)) { $sql = new db(); } $num_rows = $sql->db_Select('core', '*', "e107_name='pdf' "); if ($num_rows == 0) { $tmp = $this->getDefaultPDFPrefs(); $tmp2 = $eArrayStorage->WriteArray($tmp); $sql->db_Insert('core', "'pdf', '" . $tmp2 . "' "); $sql->db_Select('core', '*', "e107_name='pdf' "); } $row = $sql->db_Fetch(); $pdfPref = $eArrayStorage->ReadArray($row['e107_value']); return $pdfPref; }
$item_name = $row["item_name"]; $item_description = strip_tags($tp->toHTML($row["item_description"], true)); $item_image = $row["item_image"]; $item_active_status = $row["item_active_status"]; $item_price = $row["item_price"]; $discount_id = $row["discount_id"]; $discount_class = $row["discount_class"]; $discount_valid_from = $row["discount_valid_from"]; $discount_valid_till = $row["discount_valid_till"]; $discount_code = $row["discount_code"]; $discount_flag = $row["discount_flag"]; $discount_percentage = $row["discount_percentage"]; $discount_price = $row["discount_price"]; $property_prices = $row["property_prices"]; // Retrieve shop settings $sql->db_Select(DB_TABLE_SHOP_PREFERENCES, "*", "store_id=1"); if ($row = $sql->db_Fetch()) { $store_image_path = $row['store_image_path']; $set_currency_behind = $row['set_currency_behind']; } // Check admin setting to set currency behind amount // 0 = currency before amount (default), 1 = currency behind amount if ($set_currency_behind == '') { $set_currency_behind = 0; } // Define position of currency character $sql->db_Select(DB_TABLE_SHOP_CURRENCY, "*", "currency_active=2"); if ($row = $sql->db_Fetch()) { $unicode_character = $row['unicode_character']; $paypal_currency_code = $row['paypal_currency_code']; }
require_once 'includes/config.php'; // Get language file (assume that the English language file is always present) include_lan(e_PLUGIN . 'easyshop/languages/' . e_LANGUAGE . '.php'); // Read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; require_once 'includes/ipn_functions.php'; require_once 'easyshop_class.php'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&{$key}={$value}"; } $log = fopen("ipn.log", "a"); fwrite($log, "\n\nipn - " . gmstrftime("%b %d %Y %H:%M:%S", time())); // Retrieve the sandbox setting from the shop preferences $sql = new db(); $sql->db_Select(DB_TABLE_SHOP_PREFERENCES, "*", "store_id=1"); if ($row = $sql->db_Fetch()) { $sandbox = $row['sandbox']; $paypal_primary_email = $row['paypal_primary_email']; } if ($sandbox == 2) { $actionDomain = "www.sandbox.paypal.com"; } else { $actionDomain = "www.paypal.com"; } // Post back to PayPal system to validate $header = "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Host: " . $actionDomain . "\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen('ssl://' . $actionDomain, "443", $errno, $errstr, 30);
function convert_row($name, $query, $startorder) { global $sql, $tp, $plugintable; $plugintable = "pcontent"; // ##### STAGE 8 : INSERT ROW ------------------------------------------------------------- if (!is_object($sql)) { $sql = new db(); } if (!($thiscount = $sql->db_Select("content", "*", " " . $query . " ORDER BY content_id "))) { $check_present = false; } else { $count = $startorder; $check_present = true; while ($row = $sql->db_Fetch()) { $oldcontentid = $row['content_id']; //select main parent id if (!is_object($sql2)) { $sql2 = new db(); } $sql2->db_Select($plugintable, "content_id", "content_heading = '" . $name . "' AND content_parent = '0' "); list($main_id) = $sql2->db_Fetch(); //item is in main cat if ($row['content_parent'] == "0") { $newcontent_parent = $main_id; //item is in sub cat } else { //select old review cat heading if (!is_object($sql3)) { $sql3 = new db(); } if (!$sql3->db_Select("content", "content_id, content_heading", "content_id = '" . $row['content_parent'] . "' ")) { $bug_oldcat[] = $row['content_id'] . " " . $row['content_heading']; $newcontent_parent = $main_id; } else { list($old_cat_id, $old_cat_heading) = $sql3->db_Fetch(); //select new cat id from the cat with the old_cat_heading if (!is_object($sql4)) { $sql4 = new db(); } if (!$sql4->db_Select($plugintable, "content_id", "content_heading = '" . $old_cat_heading . "' AND content_parent = '0." . $main_id . "' ")) { $bug_newcat[] = $row['content_id'] . " " . $row['content_heading']; $newcontent_parent = $main_id; } else { list($new_cat_id) = $sql4->db_Fetch(); $newcontent_parent = $new_cat_id; } } } if (strstr($row['content_content'], "{EMAILPRINT}")) { $row['content_content'] = str_replace("{EMAILPRINT}", "", $row['content_content']); } $newcontent_heading = $tp->toDB($row['content_heading']); $newcontent_subheading = $row['content_subheading'] ? $tp->toDB($row['content_subheading']) : ""; //summary can contain link to image in e107_images/link_icons/".$summary." THIS STILL NEEDS TO BE CHECKED $newcontent_summary = $row['content_summary'] ? $tp->toDB($row['content_summary']) : ""; $newcontent_text = $tp->toDB($row['content_content']); //$newcontent_author = (is_numeric($row['content_author']) ? $row['content_author'] : "0^".$row['content_author']); $newcontent_author = $row['content_author']; $newcontent_icon = ""; $newcontent_attach = ""; $newcontent_images = ""; $newcontent_comment = $row['content_comment']; $newcontent_rate = "0"; $newcontent_pe = $row['content_pe_icon']; $newcontent_refer = $row['content_type'] == "15" || $row['content_type'] == "16" ? "sa" : ""; $newcontent_starttime = $row['content_datestamp']; $newcontent_endtime = "0"; $newcontent_class = $row['content_class']; $newcontent_pref = ""; $newcontent_score = $row['content_review_score'] && $row['content_review_score'] != "none" ? $row['content_review_score'] : "0"; $newcontent_meta = ""; $newcontent_layout = ""; if (!is_object($sql5)) { $sql5 = new db(); } $sql5->db_Insert($plugintable, "'" . $row['content_id'] . "', '" . $newcontent_heading . "', '" . $newcontent_subheading . "', '" . $newcontent_summary . "', '" . $newcontent_text . "', '" . $newcontent_author . "', '" . $newcontent_icon . "', '" . $newcontent_attach . "', '" . $newcontent_images . "', '" . $newcontent_parent . "', '" . $newcontent_comment . "', '" . $newcontent_rate . "', '" . $newcontent_pe . "', '" . $newcontent_refer . "', '" . $newcontent_starttime . "', '" . $newcontent_endtime . "', '" . $newcontent_class . "', '" . $newcontent_pref . "', '1." . $count . "', '" . $newcontent_score . "', '" . $newcontent_meta . "', '" . $newcontent_layout . "' "); if (!is_object($sql6)) { $sql6 = new db(); } if (!$sql6->db_Select($plugintable, "content_id, content_heading", "content_heading = '" . $newcontent_heading . "' ")) { $bug_insert[] = $row['content_id'] . " " . $row['content_heading']; } else { $valid_insert[] = $row['content_id'] . " " . $row['content_heading']; $count = $count + 1; } } } $convert_row = array($check_present, $count, $valid_insert, $bug_insert, $bug_oldcat, $bug_newcat); return $convert_row; }
$feed['name'] = 'Featurebox'; $feed['url'] = 'featurebox'; //the identifier for the rss feed url $feed['topic_id'] = ''; //the topic_id, empty on default (to select a certain category) $feed['path'] = 'featurebox'; //this is the plugin path location $feed['text'] = 'this is the rss feed for the featurebox entries'; $feed['class'] = '0'; $feed['limit'] = '9'; $eplug_rss_feed[] = $feed; //##### ------------------------------------------------------------------------------------ //##### create rss data, return as array $eplug_rss_data ----------------------------------- $rss = array(); $sqlrss = new db(); if ($items = $sqlrss->db_Select('featurebox', "*", "fb_class = 0 DESC LIMIT 0," . $this->limit)) { $i = 0; while ($rowrss = $sqlrss->db_Fetch()) { $rss[$i]['author'] = ''; $rss[$i]['author_email'] = ''; $rss[$i]['link'] = ''; $rss[$i]['linkid'] = ''; $rss[$i]['title'] = $rowrss['fb_title']; $rss[$i]['description'] = $rowrss['fb_text']; $rss[$i]['category_name'] = ''; $rss[$i]['category_link'] = ''; $rss[$i]['datestamp'] = ''; $rss[$i]['enc_url'] = ''; $rss[$i]['enc_leng'] = ''; $rss[$i]['enc_type'] = ''; $i++;
| | For the e107 website system visit http://e107.org | | Released under the terms and conditions of the | GNU General Public License (http://gnu.org). +------------------------------------------------------------------------------+ */ // class2.php is the heart of e107, always include it first to give access to e107 constants and variables require_once '../../class2.php'; // Get language file (assume that the English language file is always present) include_lan(e_PLUGIN . 'easyshop/languages/' . e_LANGUAGE . '.php'); // use HEADERF for USER PAGES and e_ADMIN."auth.php" for admin pages require_once HEADERF; require_once 'includes/config.php'; $sql = new db(); $sql->db_Select(DB_TABLE_SHOP_PREFERENCES); while ($row = $sql->db_Fetch()) { $store_name = $row['store_name']; $store_address_1 = $row['store_address_1']; $store_address_2 = $row['store_address_2']; $store_city = $row['store_city']; $store_state = $row['store_state']; $store_zip = $row['store_zip']; $store_country = $row['store_country']; $support_email = $row['support_email']; $store_welcome_message = $row['store_welcome_message']; $store_info = $row['store_info']; $thank_you_page_title = $row['thank_you_page_title']; $thank_you_page_text = $row['thank_you_page_text']; } // Reset the shopping basket arrays when thank you page is called
/** * Generates a random user login name according to some pattern. * Checked for uniqueness. * * @param string $pattern - defines the format of the username * @param int $seed - may be used with the random pattern generator * * @return string a user login name, guaranteed unique in the database. */ public function generateUserLogin($pattern, $seed = '') { $ul_sql = new db(); if (strlen($pattern) < 6) { $pattern = '##....'; } do { $newname = $this->generateRandomString($pattern, $seed); } while ($ul_sql->db_Select('user', 'user_id', "`user_loginname`='{$newname}'")); return $newname; }
require_once "../../class2.php"; } require_once HEADERF; require_once e_PLUGIN . "e107dkp/includes/config.php"; global $pref; $item = $_GET['i']; $userID = USERID; if (!$_GET['i']) { header("Location: /index.php"); } if ($pref['wcm_version']) { require_once e_PLUGIN . "wcm/includes/config.php"; $charID = WCMgetCharInfoByName($character, "char_id"); if (WCMCheckChar($userID, $charID) || WCMCheckCharAdmin()) { $sql99 = new db(); $sql99->db_Select(DKPDB_TABLE_ITEMS, "item_name", "item_id='" . $item . "'"); while ($row99 = $sql99->db_Fetch()) { $item_name = $row99["item_name"]; } if (empty($item_name)) { $text .= "No item data could be located with the name provided: {$item_name}<br>"; } else { $text .= ' <table width="100%" border="0" cellspacing="1" cellpadding="2"> <tr class="rowhead"> <th align="center" colspan="4"><u>Purchase History for ' . $item_name . '</u></th> </tr> <tr> <th align="left" width="90" nowrap="nowrap">Date</th> <th align="left" width="35%">Buyer</th>
function forumUpdateLastpost($type, $id, $updateThreads = false) { global $sql, $tp; $sql2 = new db(); if ($type == 'thread') { $id = (int) $id; $lpInfo = $this->threadGetLastpost($id); $tmp = array(); if ($lpInfo['user_name']) { $tmp['thread_lastuser'] = $lpInfo['post_user']; $tmp['thread_lastuser_anon'] = '_NULL_'; } else { $tmp['thread_lastuser'] = 0; $tmp['thread_lastuser_anon'] = $lpInfo['post_user_anon'] ? $lpInfo['post_user_anon'] : 'Anonymous'; } $tmp['thread_lastpost'] = $lpInfo['post_datestamp']; $info = array(); $info['data'] = $tmp; // $info['_FIELD_TYPES'] = $this->fieldTypes['forum_thread']; $info['WHERE'] = 'thread_id = ' . $id; $sql->db_Update('forum_thread', $info); return $lpInfo; } if ($type == 'forum') { if ($id == 'all') { if ($sql->db_Select('forum', 'forum_id', 'forum_parent != 0')) { while ($row = $sql->db_Fetch(MYSQL_ASSOC)) { $parentList[] = $row['forum_id']; } foreach ($parentList as $id) { set_time_limit(60); $this->forumUpdateLastpost('forum', $id, $updateThreads); } } } else { $id = (int) $id; $lp_info = ''; $lp_user = '******'; if ($updateThreads == true) { if ($sql2->db_Select('forum_t', 'thread_id', "thread_forum_id = {$id} AND thread_parent = 0")) { while ($row = $sql2->db_Fetch(MYSQL_ASSOC)) { set_time_limit(60); $this->forumUpdateLastpost('thread', $row['thread_id']); } } } if ($sql->db_Select('forum_thread', 'thread_id, thread_lastuser, thread_lastuser_anon, thread_datestamp', 'thread_forum_id=' . $id . ' ORDER BY thread_datestamp DESC LIMIT 1')) { $row = $sql->db_Fetch(MYSQL_ASSOC); $lp_info = $row['thread_datestamp'] . '.' . $row['thread_id']; $lp_user = $row['thread_lastuser']; } if ($row['thread_lastuser_anon']) { $sql->db_Update('forum', "forum_lastpost_user = 0, forum_lastpost_anon = '{$row['thread_lastuser_anon']}', forum_lastpost_info = '{$lp_info}' WHERE forum_id=" . $id); } else { $sql->db_Update('forum', "forum_lastpost_user = {$lp_user}, forum_lastpost_user_anon = NULL, forum_lastpost_info = '{$lp_info}' WHERE forum_id=" . $id); } } } }
function CreateParentMenu($parentid) { global $plugintable, $plugindir, $tp, $datequery; if (!is_object($sqlcreatemenu)) { $sqlcreatemenu = new db(); } if (!$sqlcreatemenu->db_Select($plugintable, "*", "content_id='" . intval($parentid) . "' ")) { return FALSE; } else { $row = $sqlcreatemenu->db_Fetch(); } $content_path_menu = $plugindir . "menus/"; if (!is_writable($content_path_menu)) { echo "<b>" . CONTENT_ADMIN_ITEM_LAN_22 . " " . $content_path_menu . " " . CONTENT_ADMIN_ITEM_LAN_23 . "</b><br />"; return FALSE; } $menufile = "content_" . $row['content_heading']; $menuname = $row['content_heading']; $data = chr(60) . "?php\n" . chr(47) . "*\n+---------------------------------------------------------------+\n| e107 website system\n| " . e_PLUGIN . "content/menus/" . $menufile . "_menu.php\n|\n| (C)Steve Dunstan 2001-2002\n| http://e107.org\n| jalist@e107.org\n|\n| Released under the terms and conditions of the\n| GNU General Public License (http://gnu.org).\n+---------------------------------------------------------------+\n\nThis file has been generated by " . e_PLUGIN . "content/handlers/content_class.php.\n\n*" . chr(47) . "\n\n"; $data .= "\n"; $data .= "unset(\$text);\n"; $data .= "\$text = \"\";\n"; $data .= "\$menutypeid\t\t= \"{$parentid}\";\n"; $data .= "\$menuname\t\t= \"{$menuname}\";\n"; $data .= "\n"; $data .= "\$plugindir\t\t= e_PLUGIN.'content/';\n"; $data .= "\$plugintable\t= \"pcontent\";\t\t//name of the table used in this plugin (never remove this, as it's being used throughout the plugin !!)\n"; $data .= "\$datequery\t\t= \" AND content_datestamp < \".time().\" AND (content_enddate=0 || content_enddate>\".time().\") \";\n"; $data .= "\n"; $data .= "require_once(e_PLUGIN.'content/handlers/content_class.php');\n"; $data .= "\$aa = new content;\n"; $data .= "require_once(e_HANDLER.'form_handler.php');\n"; $data .= "\$rs = new form;\n"; $data .= "\$gen = new convert;\n"; $data .= "global \$tp;\n"; $data .= "\n"; $data .= "include_lan(e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content.php');\n"; $data .= ' $bullet = \'\'; if(defined(\'BULLET\')) { $bullet = \'<img src="\'.THEME.\'images/\'.BULLET.\'" alt="" style="vertical-align: middle;" />\'; } elseif(file_exists(THEME.\'images/bullet2.gif\')) { $bullet = \'<img src="\'.THEME.\'images/bullet2.gif" alt="" style="vertical-align: middle;" />\'; } '; $data .= "\$content_pref\t\t\t\t\t= \$aa -> getContentPref(\$menutypeid);\n"; $data .= "\$content_icon_path\t\t\t\t= \$tp -> replaceConstants(\$content_pref[\"content_icon_path\"]);\n"; $data .= "\$content_cat_icon_path_small\t= \$tp -> replaceConstants(\$content_pref[\"content_cat_icon_path_small\"]);\n"; $data .= "\n"; $data .= "\t\$break = FALSE;\n"; $data .= "//##### SEARCH SELECT ORDER --------------------------------------------------\n"; $data .= "//show search box\n"; $data .= "if(\$content_pref[\"content_menu_search\"]){\n"; $data .= "\t\$text .= \$aa -> showOptionsSearch(\"menu\", \$menutypeid);\n"; $data .= "\t\$break = TRUE;\n"; $data .= "}\n"; $data .= "//show select box (with either links to other content pages, to categories, to both, or don't show at all)\n"; $data .= "if( (\$content_pref[\"content_menu_links\"] && \$content_pref[\"content_menu_links_dropdown\"]) || (\$content_pref[\"content_menu_cat\"] && \$content_pref[\"content_menu_cat_dropdown\"]) ){\n"; $data .= "\t\$text .= \$aa -> showOptionsSelect(\"menu\", \$menutypeid);\n"; $data .= "\t\$break = TRUE;\n"; $data .= "}\n"; $data .= "//show order box\n"; $data .= "if(\$content_pref[\"content_menu_sort\"]){\n"; $data .= "\t\$text .= \$aa -> showOptionsOrder(\"menu\", \$menutypeid);\n"; $data .= "\t\$break = TRUE;\n"; $data .= "}\n"; $data .= "\n"; $data .= "//show links list if chosen so\n"; $data .= "if(\$content_pref[\"content_menu_links\"] && !\$content_pref[\"content_menu_links_dropdown\"]){\n"; $data .= "\tif(\$break === TRUE){\n"; $data .= "\t \$text .= \"<br />\";\n"; $data .= "\t}\n"; $data .= "\t\$text .= (\$content_pref[\"content_menu_links_caption\"] != \"\" ? \$content_pref[\"content_menu_links_caption\"] : CONTENT_MENU_LAN_4).\"<br />\";\n"; $data .= "\n"; $data .= "\t//define icon\n"; $data .= "\tif(\$content_pref[\"content_menu_links_icon\"] == \"0\"){ \$linksicon = \"\";\n"; $data .= "\t}elseif(\$content_pref[\"content_menu_links_icon\"] == \"1\"){ \$linksicon = \$bullet;\n"; $data .= "\t}elseif(\$content_pref[\"content_menu_links_icon\"] == \"2\"){ \$linksicon = \"·\";\n"; $data .= "\t}elseif(\$content_pref[\"content_menu_links_icon\"] == \"3\"){ \$linksicon = \"º\";\n"; $data .= "\t}elseif(\$content_pref[\"content_menu_links_icon\"] == \"4\"){ \$linksicon = \"»\";\n"; $data .= "\t}\n"; $data .= "\n"; $data .= "\$urlrow[\"url_content_id\"]\t\t= \$menutypeid;\n"; $data .= "\tif(\$content_pref[\"content_menu_viewallcat\"]){\n"; $data .= "\t\t\$text .= \$linksicon.\" <a href='\".e107::url(\"content\", \"catlist\", \$urlrow, \"full\").\"'>\".CONTENT_LAN_6.\"</a><br />\";\n"; $data .= "\t}\n"; $data .= "\tif(\$content_pref[\"content_menu_viewallauthor\"]){\n"; $data .= "\t\t\$text .= \$linksicon.\" <a href='\".e107::url(\"content\", \"authors\", \$urlrow, \"full\").\"'>\".CONTENT_LAN_7.\"</a><br />\";\n"; $data .= "\t}\n"; $data .= "\tif(\$content_pref[\"content_menu_viewallitems\"]){\n"; $data .= "\t\t\$text .= \$linksicon.\" <a href='\".e107::url(\"content\", \"archive\", \$urlrow, \"full\").\"'>\".CONTENT_LAN_83.\"</a><br />\";\n"; $data .= "\t}\n"; $data .= "\tif(\$content_pref[\"content_menu_viewtoprated\"]){\n"; $data .= "\t\t\$text .= \$linksicon.\" <a href='\".e107::url(\"content\", \"toprated\", \$urlrow, \"full\").\"'>\".CONTENT_LAN_8.\"</a><br />\";\n"; $data .= "\t}\n"; $data .= "\tif(\$content_pref[\"content_menu_viewtopscore\"]){\n"; $data .= "\t\t\$text .= \$linksicon.\" <a href='\".e107::url(\"content\", \"topscore\", \$urlrow, \"full\").\"'>\".CONTENT_LAN_12.\"</a><br />\";\n"; $data .= "\t}\n"; $data .= "\tif(\$content_pref[\"content_menu_viewrecent\"]){\n"; $data .= "\t\t\$text .= \$linksicon.\" <a href='\".e107::url(\"content\", \"recent\", \$urlrow, \"full\").\"'>\".CONTENT_LAN_61.\"</a><br />\";\n"; $data .= "\t}\n"; $data .= "\tif( \$content_pref[\"content_menu_viewsubmit\"] && \$content_pref[\"content_submit\"] && check_class(\$content_pref[\"content_submit_class\"]) ){\n"; $data .= "\t\t\$text .= \$linksicon.\" <a href='\".\$plugindir.\"content_submit.php'>\".CONTENT_LAN_75.\"</a><br />\";\n"; $data .= "\t}\n"; $data .= "\t\$text .= \"<br />\";\n"; $data .= "}\n"; $data .= "\n"; $data .= "//get category array\n"; $data .= "\$array = \$aa -> getCategoryTree(\"\", intval(\$menutypeid), TRUE);\n"; $data .= "\n"; $data .= "//##### CATEGORY LIST --------------------------------------------------\n"; $data .= "if(!\$content_pref[\"content_menu_cat_dropdown\"]){\n"; $data .= "\tif(\$content_pref[\"content_menu_cat\"]){\n"; $data .= "\t\t\$text .= (\$content_pref[\"content_menu_cat_caption\"] != \"\" ? \$content_pref[\"content_menu_cat_caption\"] : CONTENT_MENU_LAN_3).\"<br />\";\n"; $data .= "\n"; $data .= "\t\t\$newparent = \"\";\n"; $data .= "\t\t\$checkid = \"\";\n"; $data .= "\t\t\$newarray = array_merge_recursive(\$array);\n"; $data .= "\t\tfor(\$a=0;\$a<count(\$newarray);\$a++){\n"; $data .= "\t\t\tfor(\$b=0;\$b<count(\$newarray[\$a]);\$b++){\n"; $data .= "\t\t\t\t\$newparent[\$newarray[\$a][\$b]] = \$newarray[\$a][\$b+1];\n"; $data .= "\t\t\t\tif( (\$content_pref[\"content_menu_cat_main\"] && \$newarray[\$a][\$b] == \$menutypeid) || \$newarray[\$a][\$b] != \$menutypeid ){\n"; $data .= "\t\t\t\t\t\$checkid .= \" content_id = '\".\$newarray[\$a][\$b].\"' OR \";\n"; $data .= "\t\t\t\t}\n"; $data .= "\t\t\t\t\$b++;\n"; $data .= "\t\t\t}\n"; $data .= "\t\t}\n"; $data .= "\t\t\$checkid = substr(\$checkid,0,-3);\n"; $data .= "\t\tif(!is_object(\$sql)){ \$sql = new db; }\n"; $data .= "\t\tif(\$sql -> db_Select(\$plugintable, \"*\", \" \".\$checkid.\" ORDER BY SUBSTRING_INDEX(content_order, '.', 1)+0 \")){\n"; $data .= "\t\t\twhile(\$row = \$sql -> db_Fetch()){\n"; $data .= "\n"; $data .= "\t\t\t\t//define icon\n"; $data .= "\t\t\t\t\$ICON = \"\";\n"; $data .= "\t\t\t\tif(\$content_pref[\"content_menu_cat_icon\"] == \"0\"){ \$ICON = \"\";\n"; $data .= "\t\t\t\t}elseif(\$content_pref[\"content_menu_cat_icon\"] == \"1\"){ \$ICON = \$bullet;\n"; $data .= "\t\t\t\t}elseif(\$content_pref[\"content_menu_cat_icon\"] == \"2\"){ \$ICON = \"·\";\n"; $data .= "\t\t\t\t}elseif(\$content_pref[\"content_menu_cat_icon\"] == \"3\"){ \$ICON = \"º\";\n"; $data .= "\t\t\t\t}elseif(\$content_pref[\"content_menu_cat_icon\"] == \"4\"){ \$ICON = \"»\";\n"; $data .= "\t\t\t\t}elseif(\$content_pref[\"content_menu_cat_icon\"] == \"5\"){\n"; $data .= "\t\t\t\t\tif(\$row['content_icon'] != \"\" && file_exists(\$content_cat_icon_path_small.\$row['content_icon']) ){\n"; $data .= "\t\t\t\t\t\t\$ICON = \"<img src='\".\$content_cat_icon_path_small.\$row['content_icon'].\"' alt='' style='border:0;' />\";\n"; $data .= "\t\t\t\t\t}else{\n"; $data .= "\t\t\t\t\t\t//default category icon\n"; $data .= "\t\t\t\t\t\tif(\$content_pref[\"content_menu_cat_icon_default\"] == \"0\"){ \$ICON = \"\";\n"; $data .= "\t\t\t\t\t\t}elseif(\$content_pref[\"content_menu_cat_icon_default\"] == \"1\"){ \$ICON = \$bullet;\n"; $data .= "\t\t\t\t\t\t}elseif(\$content_pref[\"content_menu_cat_icon_default\"] == \"2\"){ \$ICON = \"·\";\n"; $data .= "\t\t\t\t\t\t}elseif(\$content_pref[\"content_menu_cat_icon_default\"] == \"3\"){ \$ICON = \"º\";\n"; $data .= "\t\t\t\t\t\t}elseif(\$content_pref[\"content_menu_cat_icon_default\"] == \"4\"){ \$ICON = \"»\";\n"; $data .= "\t\t\t\t\t\t}\n"; $data .= "\t\t\t\t\t}\n"; $data .= "\t\t\t\t}\n"; $data .= "\t\t\t\t//display category list\n"; $data .= "\t\t\t\t\$text .= \"<table style='width:100%; text-align:left; border:0;' cellpadding='0' cellspacing='0'>\";\n"; $data .= "\t\t\t\t\$text .= \"<tr>\";\n"; $data .= "\t\t\t\t\$text .= (\$ICON ? \"<td style='width:1%; white-space:nowrap; text-align:left; padding-right:5px;'><a href='\".e_PLUGIN.\"content/content.php?cat.\".\$row['content_id'].\"'>\".\$ICON.\"</a></td>\" : \"\");\n"; $data .= "\t\t\t\t\$text .= \"<td colspan='2'>\";\n"; $data .= "\t\t\t\t\$text .= \"<a href='\".e_PLUGIN.\"content/content.php?cat.\".\$row['content_id'].\"'>\".\$row['content_heading'].\"</a>\";\n"; $data .= "\t\t\t\t\$text .= (\$content_pref[\"content_menu_cat_number\"] ? \" <span class='smalltext'>(\".\$aa -> countCatItems(\$row['content_id']).\")</span>\" : \"\");\n"; $data .= "\t\t\t\t\$text .= \"</td>\";\n"; $data .= "\t\t\t\t\$text .= \"</tr>\";\n"; $data .= "\t\t\t\t\$text .= \"</table>\";\n"; $data .= "\t\t\t}\n"; $data .= "\t\t}\n"; $data .= "\t}\n"; $data .= "}\n"; $data .= "\n"; $data .= "//##### RECENT --------------------------------------------------\n"; $data .= "if(\$content_pref[\"content_menu_recent\"]){\n"; $data .= "\t\$text .= \"<br />\";\n"; $data .= "\n"; $data .= "\t//prepare query paramaters\n"; $data .= "\t\$validparent = implode(\",\", array_keys(\$array));\n"; $data .= "\t\$qry = \" content_parent REGEXP '\".\$aa -> CONTENTREGEXP(\$validparent).\"' \";\n"; $data .= "\n"; $data .= "\t\$sql1 = new db;\n"; $data .= "\t\$contenttotal = \$sql1 -> db_Count(\$plugintable, \"(*)\", \"WHERE content_refer != 'sa' AND \".\$qry.\" \".\$datequery.\" AND content_class REGEXP '\".e_CLASS_REGEXP.\"' \" );\n"; $data .= "\n"; $data .= "\tif(\$resultitem = \$sql1 -> db_Select(\$plugintable, \"*\", \"content_refer !='sa' AND \".\$qry.\" \".\$datequery.\" AND content_class REGEXP '\".e_CLASS_REGEXP.\"' ORDER BY content_datestamp DESC LIMIT 0,\".\$content_pref[\"content_menu_recent_number\"] )){\n"; $data .= "\n"; $data .= "\t\t\$text .= (\$content_pref[\"content_menu_recent_caption\"] != \"\" ? \$content_pref[\"content_menu_recent_caption\"] : CONTENT_MENU_LAN_2).\"<br />\";\n"; $data .= "\t\twhile(\$row = \$sql1 -> db_Fetch()){\n"; $data .= "\n"; $data .= "\t\t\t\$ICON = \"\";\n"; $data .= "\t\t\t\$DATE = \"\";\n"; $data .= "\t\t\t\$AUTHOR = \"\";\n"; $data .= "\t\t\t\$SUBHEADING = \"\";\n"; $data .= "\n"; $data .= "\t\t\tif(\$content_pref[\"content_menu_recent_date\"]){\n"; $data .= "\t\t\t\t\$datestyle = (\$content_pref[\"content_archive_datestyle\"] ? \$content_pref[\"content_archive_datestyle\"] : \"%d %b %Y\");\n"; $data .= "\t\t\t\t\$DATE = strftime(\$datestyle, \$row['content_datestamp']);\n"; $data .= "\t\t\t}\n"; $data .= "\t\t\tif(\$content_pref[\"content_menu_recent_author\"]){\n"; $data .= "\t\t\t\t\$authordetails = \$aa -> getAuthor(\$row['content_author']);\n"; $data .= "\t\t\t\t\$AUTHOR = \$authordetails[1];\n"; $data .= "\t\t\t}\n"; $data .= "\n"; $data .= "\t\t\t//subheading\n"; $data .= "\t\t\tif(\$content_pref[\"content_menu_recent_subheading\"] && \$row['content_subheading']){\n"; $data .= "\t\t\t\tif(\$content_pref[\"content_menu_recent_subheading_char\"] && \$content_pref[\"content_menu_recent_subheading_char\"] != \"\" && \$content_pref[\"content_menu_recent_subheading_char\"] != \"0\"){\n"; $data .= "\t\t\t\t\tif(strlen(\$row['content_subheading']) > \$content_pref[\"content_menu_recent_subheading_char\"]) {\n"; $data .= "\t\t\t\t\t\t\$row['content_subheading'] = substr(\$row['content_subheading'], 0, \$content_pref[\"content_menu_recent_subheading_char\"]).\$content_pref[\"content_menu_recent_subheading_post\"];\n"; $data .= "\t\t\t\t\t}\n"; $data .= "\t\t\t\t}\n"; $data .= "\t\t\t\t\$SUBHEADING = \$row['content_subheading'];\n"; $data .= "\t\t\t}\n"; $data .= "\n"; $data .= "\t\t\t//define icon\n"; $data .= "\t\t\t\$recenticonwidth = \"\";\n"; $data .= "\t\t\tif(\$content_pref[\"content_menu_recent_icon\"] == \"0\"){ \$ICON = \"\";\n"; $data .= "\t\t\t}elseif(\$content_pref[\"content_menu_recent_icon\"] == \"1\"){ \$ICON = \$bullet;\n"; $data .= "\t\t\t}elseif(\$content_pref[\"content_menu_recent_icon\"] == \"2\"){ \$ICON = \"·\";\n"; $data .= "\t\t\t}elseif(\$content_pref[\"content_menu_recent_icon\"] == \"3\"){ \$ICON = \"º\";\n"; $data .= "\t\t\t}elseif(\$content_pref[\"content_menu_recent_icon\"] == \"4\"){ \$ICON = \"»\";\n"; $data .= "\t\t\t}elseif(\$content_pref[\"content_menu_recent_icon\"] == \"5\"){\n"; $data .= "\t\t\t\tif(\$content_pref[\"content_menu_recent_icon\"] == \"5\"){\n"; $data .= "\t\t\t\t\tif(\$content_pref[\"content_menu_recent_icon_width\"]){\n"; $data .= "\t\t\t\t\t\t\$recenticonwidth = \" width:\".\$content_pref[\"content_menu_recent_icon_width\"].\"px; \";\n"; $data .= "\t\t\t\t\t}else{\n"; $data .= "\t\t\t\t\t\t\$recenticonwidth = \" width:50px; \";\n"; $data .= "\t\t\t\t\t}\n"; $data .= "\t\t\t\t}\n"; $data .= "\t\t\t\tif(\$content_pref[\"content_menu_recent_icon\"] == \"5\" && \$row['content_icon'] != \"\" && file_exists(\$content_icon_path.\$row['content_icon'])){\n"; $data .= "\t\t\t\t\t\$ICON = \"<img src='\".\$content_icon_path.\$row['content_icon'].\"' alt='' style='\".\$recenticonwidth.\" border:0;' />\";\n"; $data .= "\t\t\t\t}\n"; $data .= "\t\t\t}\n"; $data .= "\n"; $data .= "\t\t\t//display recent list\n"; $data .= "\t\t\t\$text .= \"<table style='width:100%; text-align:left; border:0; margin-bottom:10px;' cellpadding='0' cellspacing='0'>\";\n"; $data .= "\t\t\t\$text .= \"<tr>\";\n"; $data .= "\t\t\t\$text .= (\$ICON ? \"<td style='width:1%; white-space:nowrap; vertical-align:top; padding-right:5px;'><a href='\".e_PLUGIN.\"content/content.php?content.\".\$row['content_id'].\"'>\".\$ICON.\"</a></td>\" : \"\");\n"; $data .= "\t\t\t\$text .= \"<td style='width:99%; vertical-align:top;'>\";\n"; $data .= "\t\t\t\$text .= \"<a href='\".e_PLUGIN.\"content/content.php?content.\".\$row['content_id'].\"'>\".\$row['content_heading'].\"</a><br />\";\n"; $data .= "\t\t\t\$text .= (\$DATE ? \$DATE.\"<br />\" : \"\" );\n"; $data .= "\t\t\t\$text .= (\$AUTHOR ? \$AUTHOR.\"<br />\" : \"\" );\n"; $data .= "\t\t\t\$text .= (\$SUBHEADING ? \$SUBHEADING.\"<br />\" : \"\" );\n"; $data .= "\t\t\t\$text .= \"</td>\";\n"; $data .= "\t\t\t\$text .= \"</tr>\";\n"; $data .= "\t\t\t\$text .= \"</table>\";\n"; $data .= "\t\t}\n"; $data .= "\t}\n"; $data .= "}\n"; $data .= "\n"; $data .= "if(!isset(\$text)){ \$text = CONTENT_MENU_LAN_1; }\n"; $data .= "\$caption = (\$content_pref[\"content_menu_caption\"] != \"\" ? \$content_pref[\"content_menu_caption\"] : CONTENT_MENU_LAN_0.\" \".\$menuname);\n"; $data .= "\$ns -> tablerender(\$caption, \$text, '{$menufile}');\n"; $data .= "\n"; $data .= "?" . chr(62); if (file_exists($plugindir . "menus/" . $menufile . "_menu.php")) { $message = ""; } else { $fp = @fopen($plugindir . "menus/" . $menufile . "_menu.php", "w"); if (!@fwrite($fp, $data)) { $message = CONTENT_ADMIN_CAT_LAN_51; } else { fclose($fp); $message = CONTENT_ADMIN_CAT_LAN_50; } } return $message; }
$key = array_search(trim($_POST[$prod_prop]), ${"prop" . $n . "_array"}); // Create price array ${"price" . $n . "_array"} = explode(",", $_POST[$prop_prices]); // Adjust the price with the corresponding price $_POST['item_price'] = (double) $_POST['item_price'] + ${"price" . $n . "_array"}[$key]; // Adjust the item id $_POST['item_id'] = intval($_POST['item_id']) . trim($_POST[$prod_prop]); // Adjust item name $_POST['item_name'] = $_POST['item_name'] . " " . trim($_POST[$prod_prop]); } } } // Check on incoming discount before filling the basket // if ($_POST['discount_code'] <> "" or !isset($_POST['discount_code'])) { // Only activate when discount code is filled in //Bugfix #75 $sql = new db(); $sql->db_Select(DB_TABLE_SHOP_DISCOUNT, "*", "discount_id=" . intval($_POST['discount_id'])); // Security fix with intval if ($row = $sql->db_Fetch()) { $discount_id = $row['discount_id']; // $discount_name = $row['discount_name']; // $discount_class = $row['discount_class']; $discount_flag = $row['discount_flag']; $discount_price = number_format($row['discount_price'], 2, '.', ''); $discount_percentage = number_format($row['discount_percentage'], 2, '.', ''); $discount_valid_from = $row['discount_valid_from']; $discount_valid_till = $row['discount_valid_till']; $discount_code = $row['discount_code']; //} Removed due to Bugfix#75 $no_discount_code = false; if (!isset($_POST['discount_code']) && $discount_code == "") { // Set variable to true when no discount code is available: Bugfix #75
function view_subscribers($p_id) { $ns = e107::getRender(); $mes = e107::getMessage(); $frm = e107::getForm(); $nl_sql = new db(); $_nl_sanatized = ''; if (!$nl_sql->db_Select('newsletter', '*', 'newsletter_id=' . $p_id)) { $mes->addError(NLLAN_56); $vs_text .= "<div class='buttons-bar center'>\n\t\t\t\t\t\t\t<input class='btn btn-default button' type=button value='" . LAN_BACK . "' onClick=\"window.location='" . e_SELF . "'\">\n\t\t\t\t\t\t</div>"; $ns->tablerender(NLLAN_65 . ' ' . $p_id, $mes->render() . $vs_text); return; } else { $vs_text .= "\n\t\t\t<form action='" . e_SELF . "' id='newsletterform' method='post'>\n\t\t\t<table class='table adminlist'>\n\t\t\t<colgroup>\n\t\t\t\t<col style='width: 5%; text-align: center;' />\n\t\t\t\t<col style='width: 35%;' />\n\t\t\t\t<col style='width: 45%;' />\n\t\t\t\t<col style='width: 15%; text-align: center;' />\n\t\t\t</colgroup>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . LAN_ID . "</td>\n\t\t\t\t\t<td>" . LAN_NAME . "</td>\n\t\t\t\t\t<td>" . LAN_EMAIL . "</td>\n\t\t\t\t\t<td>" . LAN_OPTIONS . "</td>\n\t\t\t\t</tr>"; if ($nl_row = $nl_sql->db_Fetch()) { $subscribers_list = explode(chr(1), trim($nl_row['newsletter_subscribers'])); sort($subscriber_list); $subscribers_total_count = count($subscribers_list) - 1; // Get a null entry as well } if ($subscribers_total_count < 1) { header("location:" . e_SELF); exit; } // Loop through each user in the array subscribers_list & sanatize $_last_subscriber = ''; foreach ($subscribers_list as $val) { $val = trim($val); if ($val) { if ($val != $_last_subscriber) { $nl_sql->db_Select("user", "*", "user_id=" . $val); if ($nl_row = $nl_sql->db_Fetch()) { $vs_text .= "\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . $val . "</td>\n\t\t\t\t\t\t\t\t<td><a href='" . e_BASE . "user.php?id.{$val}'>" . $nl_row['user_name'] . "</a></td>\n\t\t\t\t\t\t\t\t<td>" . $nl_row['user_email'] . "</td>\n\t\t\t\t\t\t\t\t<td><a href='" . e_SELF . "?remove.{$p_id}.{$val}'>" . ADMIN_DELETE_ICON . "</a>" . ($nl_row['user_ban'] > 0 ? NLLAN_62 : "") . "</td>\n\t\t\t\t\t\t\t</tr>"; $_last_subscriber = $val; } } else { // Duplicate user id found in the subscribers_list array! newsletter::remove_subscribers($p_id, $val); // removes all entries for this user id $newsletterArray[$p_id]['newsletter_subscribers'] = chr(1) . $val; // keep this single value in the list $nl_sql->db_Update("newsletter", "newsletter_subscribers='" . $newsletterArray[$p_id]['newsletter_subscribers'] . "' WHERE newsletter_id='" . intval($p_id) . "'"); $subscribers_total_count--; $_nl_sanatized = 1; } } } } $vs_text .= "\n\t\t<tr>\n\t\t\t<td colspan='4'>" . NLLAN_63 . ": " . $subscribers_total_count . "</td>\n\t\t</tr>\n\t\t </table>\n\t\t\t <div class='buttons-bar center'>\n\t\t\t \t" . $frm->admin_button('submit', LAN_BACK, 'submit') . "\n\t\t\t </div>\t\t\t\n\t\t </form>\n\t\t "; if ($_nl_sanatized == 1) { $mes->addInfo(NLLAN_66); } $ns->tablerender(NLLAN_65 . ' ' . $p_id, $mes->render() . $vs_text); }
function flood($table, $orderfield) { /* # Test for possible flood # # - parameter #1 string $table, table being affected # - parameter #2 string $orderfield, date entry in respective table # - return boolean # - scope public */ $sql = new db(); if (FLOODPROTECT == true) { $sql->db_Select($table, '*', 'ORDER BY ' . $orderfield . ' DESC LIMIT 1', 'no_where'); $row = $sql->db_Fetch(); return $row[$orderfield] > time() - FLOODTIMEOUT ? false : true; } else { return TRUE; } }
} else { // --------------------------------------------------------------------------+ // ----------------------- Overview Properties ------------------------------+ // --------------------------------------------------------------------------+ // Determine if there are no properties if ($sql->db_Count(easyshop_properties) > 0) { $no_properties = 1; } $text .= "\r\n <form name='overview_prop' method='POST' action='" . e_SELF . "'>\r\n\t\t<center>\r\n\t\t\t\t<fieldset>\r\n\t\t\t\t\t<legend>\r\n\t\t\t\t\t\t" . EASYSHOP_ADMIN_PROP_01 . "\r\n\t\t\t\t\t</legend>"; // Show a message if there are no properties to display if ($no_properties == null) { $text .= "\r\n\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t<center>\r\n\t\t\t\t\t\t\t<span class='smalltext'>\r\n\t\t\t\t\t\t\t\t" . EASYSHOP_ADMIN_PROP_02 . "\r\n\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t</center>\r\n\t\t\t\t\t\t<br />"; } else { $text .= "\r\n\t\t\t\t\t\t<center>\r\n\t\t\t\t\t\t <table style='" . ADMIN_WIDTH . "' class='fborder'>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><b>" . EASYSHOP_ADMIN_PROP_04 . "</b></td>\r\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><b>" . EASYSHOP_ADMIN_PROP_05 . "</b></td>\r\n\t\t\t\t\t\t\t\t\t<td class='fcaption'><center><b>" . EASYSHOP_ADMIN_PROP_09 . "</b></center></td>\r\n\t\t\t\t\t\t\t\t</tr>"; // Select the properties in the alphabetical order $sql->db_Select(easyshop_properties, "*", "ORDER BY prop_display_name", "no-where"); // While there are records available; fill the rows while ($row = $sql->db_Fetch()) { $text .= "\r\n\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td class='forumheader3'>" . $row['prop_display_name'] . "</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class='forumheader3'>" . $row['prop_list'] . "</td>\r\n\t\t\t\t\t\t\t\t\t\t"; // Show the edit and delete icons $text .= "\r\n\t\t\t\t\t\t\t\t\t\t<td class='forumheader3'>\r\n\t\t\t\t\t\t\t\t\t\t\t<center>\r\n\t\t\t\t\t\t\t\t\t\t\t<a href='admin_properties.php?edit." . $row['property_id'] . "' alt='" . EASYSHOP_ADMIN_PROP_10 . "'>" . ADMIN_EDIT_ICON . "</a>\r\n \r\n\t\t\t\t\t\t\t\t\t\t\t<a href='admin_properties.php?delete." . $row['property_id'] . "' alt='" . EASYSHOP_ADMIN_PROP_11 . "'>" . ADMIN_DELETE_ICON . "</a>"; $text .= "\r\n\t\t\t\t\t\t\t\t\t\t\t</center>\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t</tr>"; } $text .= "\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t</center>"; } $text .= "\r\n\t\t\t\t\t\t<br />\r\n\t\t\t\t</fieldset>\r\n\t\t</center>\r\n\t</form>\r\n\t<br />"; // --------------------------------------------------------------------------+ // ----------------------- Create New Property ------------------------------+ // --------------------------------------------------------------------------+ $text .= "\r\n\t<form name='create_new' method='POST' action='" . e_SELF . "'>\r\n\t\t<center>\r\n\t\t\t<div style='width:80%'>\r\n\t\t\t\t<fieldset>\r\n\t\t\t\t\t<legend>\r\n\t\t\t\t\t\t" . EASYSHOP_ADMIN_PROP_03 . "\r\n\t\t\t\t\t</legend>\r\n\t\t\t\t\t<table border='0' cellspacing='15' width='100%'>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t<b>" . EASYSHOP_ADMIN_PROP_04 . "</b>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t<input class='tbox' size='25' type='text' name='prop_display_name'/>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td valign='top'>\r\n\t\t\t\t\t\t\t\t<b>" . EASYSHOP_ADMIN_PROP_05 . "</b><br />\r\n\t\t\t\t\t\t\t\t" . EASYSHOP_ADMIN_PROP_06 . "\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t<textarea class='tbox' cols='50' rows='7' name='prop_list'></textarea><br />\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t<br />\r\n\t\t\t\t<center>\r\n <input type='hidden' name='create_new' value='1'/>\r\n\t\t\t\t\t<input class='button' type='submit' value='" . EASYSHOP_ADMIN_PROP_07 . "'/>\r\n\t\t\t\t</center>\r\n\t\t\t\t<br />\r\n\t\t\t\t</fieldset>\r\n\t\t\t</div>\r\n\t\t</center>\r\n\t</form>\r\n\t<br />"; // Render the value of $text in a table.
//prepare query string $array = $aa->getCategoryTree("", $mainparent, TRUE); $validparent = implode(",", array_keys($array)); $qry = " content_refer !='sa' AND content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' AND content_class REGEXP '" . e_CLASS_REGEXP . "' "; //check so only the preferences from the correct content_type (article, content, review etc) are used and rendered if (substr($contentmode, 8) == $rowm['content_id']) { if ($mode == "new_page" || $mode == "new_menu") { $lvisit = $this->getlvisit(); $qry = $qry . " AND content_datestamp>" . $lvisit; } else { $qry = $qry . " " . $datequery; } $qry .= " ORDER BY content_datestamp DESC LIMIT 0," . intval($arr[7]); //get recent content for each main parent $sqli = new db(); if (!($resultitem = $sqli->db_Select("pcontent", "*", $qry))) { $LIST_DATA = CONTENT_MENU_LAN_5 . " " . $rowm['content_heading']; } else { $LIST_DISPLAYSTYLE = $arr[2] ? "" : "none"; while ($rowi = $sqli->db_Fetch()) { $rowheading = $this->parse_heading($rowi['content_heading'], $mode); $HEADING = "<a href='" . e_PLUGIN_ABS . "content/content.php?content." . $rowi['content_id'] . "' title='" . $rowi['content_heading'] . "'>" . $rowheading . "</a>"; //category if ($arr[4]) { $crumb = ""; if (array_key_exists($rowi['content_parent'], $array)) { $newarr = $array[$rowi['content_parent']]; $newarr = array_reverse($newarr); $CATEGORY = "<a href='" . e_PLUGIN_ABS . "content/content.php?cat." . $newarr[1] . "'>" . $newarr[0] . "</a>"; } }
function step4() { global $pref; $e107 = e107::getInstance(); $stepCaption = 'Step 4: Move user specific forum data and forum prefs'; if (!isset($_POST['move_user_data'])) { $text = "\n\t\tThis step will move the main forum preferences into its own table row. It will also move all user_viewed data from user table into the user extended table.<br />\n\t\tThe user_forum field data will not be moved, as it will be recalculated later.<br />\n\t\t<br />\n\t\tDepending on the size of your user table, this step could take a while.\n\t\t<br /><br />\n\t\t<form method='post'>\n\t\t<input class='button' type='submit' name='move_user_data' value='Proceed with user data move' />\n\t\t</form>\n\t\t"; $e107->ns->tablerender($stepCaption, $text); return; } /** Convert forum prefs to their own row **/ $fconf = e107::getPlugConfig('forum', '', false); $coreConfig = e107::getConfig(); $old_prefs = array(); foreach ($pref as $k => $v) { if (substr($k, 0, 6) == 'forum_') { $nk = substr($k, 6); echo "Converting {$k} to {$nk}<br />"; $old_prefs[$nk] = $v; $coreConfig->remove($k); } } $forumPrefList = array('reported_post_email', 'email_notify', 'email_notify_on'); foreach ($forumPrefList as $_fp) { echo "converting {$_fp} to {$_fp}<br />"; $old_prefs[$_fp] = $coreConfig->get($_fp); $coreConfig->remove($_fp); } $fconf->setPref($old_prefs)->save(false, true); $coreConfig->save(false, true); $result = array('usercount' => 0, 'viewcount' => 0, 'trackcount' => 0); $db = new db(); if ($db->db_Select('user', 'user_id, user_viewed, user_realm', "user_viewed != '' OR user_realm != ''")) { require_once e_HANDLER . 'user_extended_class.php'; $ue = new e107_user_extended(); while ($row = $db->db_Fetch(MYSQL_ASSOC)) { $result['usercount']++; $userId = (int) $row['user_id']; $viewed = $row['user_viewed']; $viewed = trim($viewed, '.'); $tmp = preg_split('#\\.+#', $viewed); $viewed = implode(',', $tmp); $realm = $row['user_realm']; $realm = str_replace('USERREALM', '', $realm); $realm = trim($realm, '-.'); $trackList = preg_split('#\\D+#', $realm); // echo 'user_id = '.$userId.'<br />'; // echo 'viewed = '.$viewed.'<br />'; // echo 'realm = '.$realm.'<br />'; // echo 'tracking = ' . implode(',', $trackList).'<br />'; // print_a($trackList); // echo "<br /><br />"; if ($viewed != '') { $ue->user_extended_setvalue($userId, 'plugin_forum_viewed', mysql_real_escape_string($viewed)); $result['viewcount']++; } if (is_array($trackList) && count($trackList)) { foreach ($trackList as $threadId) { $result['trackcount']++; $threadId = (int) $threadId; if ($threadId > 0) { $tmp = array(); $tmp['track_userid'] = $userId; $tmp['track_thread'] = $threadId; $e107->sql->db_Insert('forum_track', $tmp); } } } } } $text .= "\n\tUser data move results:<br />\n\tNumber of users processed: {$result['usercount']} <br />\n\tNumber of viewed data processed: {$result['viewcount']} <br />\n\tNumber of tracked records added: {$result['trackcount']} <br />\n\t<br /><br />\n\t<form method='post'>\n\t<input class='button' type='submit' name='nextStep[5]' value='Proceed to step 5' />\n\t</form>\n\t"; $e107->ns->tablerender($stepCaption, $text); }
// End of while for main categories } // End of if active main categories count > 0 // Select all active categories without main category (Remain backwards compatible with EasyShop 1.2 AND main category is not mandatory) $sql1 = new db(); $sql1->db_Select(DB_TABLE_SHOP_ITEM_CATEGORIES, "*", "category_active_status = '2' AND category_main_id='' AND (category_class IN (" . USERCLASS_LIST . ")) "); while ($row1 = $sql1->db_Fetch()) { $category_id = $row1['category_id']; $category_name = $row1['category_name']; $sql2 = new db(); // Count all active products of the fetched category $active_prod_count = $sql2->db_Count(DB_TABLE_SHOP_ITEMS, "(*)", "WHERE item_active_status = '2' AND category_id={$category_id}"); $l_text .= "<tr><td> <a href='" . e_PLUGIN . "easyshop/easyshop.php?cat.{$category_id}'><b>" . $category_name . "</b></a> ({$active_prod_count})</td></tr>"; $active_prod_count > 0 ? $l_text .= "<tr><td><ul>" : ""; // For valid XHTML 1.1 $sql3 = new db(); // Select all active products of the fetched category $sql3->db_Select(DB_TABLE_SHOP_ITEMS, "*", "item_active_status = '2' AND category_id={$category_id} ORDER BY item_order"); while ($row3 = $sql3->db_Fetch()) { $item_id = $row3['item_id']; $item_name = $row3['item_name']; $l_text .= "<li><a href='" . e_PLUGIN . "easyshop/easyshop.php?prod.{$item_id}'>" . $item_name . "</a></li>"; } // End of while for products $active_prod_count > 0 ? $l_text .= "</ul></td></tr>" : ""; // For valid XHTML 1.1 } // End of while for categories $l_text .= "</table>"; $caption = "<div style='text-align:center;'>" . EASYSHOP_PUBLICMENU2_01 . " (" . ($active_main_count > 0 ? $active_main_count : $active_cat_count) . ")</div>"; $ns->tablerender($caption, $l_text);
$text .= "<tr><td class='fcaption' colspan='2'>" . CONTENT_ADMIN_CONVERSION_LAN_51 . "</td></tr>"; $text .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='forumheader3' style='width:5%; white-space:nowrap; vertical-align:top;'>" . CONTENT_ICON_ERROR . " " . count($unknown_array[0]) . " " . CONTENT_ADMIN_CONVERSION_LAN_51 . "</td>\n\t\t\t\t\t<td class='forumheader3'>\n\t\t\t\t\t\t<a style='cursor: pointer; cursor: hand' onclick=\"expandit('unknownrows');\">" . CONTENT_ADMIN_CONVERSION_LAN_48 . "</a>\n\t\t\t\t\t\t<div id='unknownrows' style='display: none;'>\n\t\t\t\t\t\t\t<table style='width:100%; border:0;'>"; for ($i = 0; $i < count($unknown_array[0]); $i++) { $text .= "<tr><td style='width:25%; white-space:nowrap;'>" . CONTENT_ICON_ERROR . " " . $unknown_array[0][$i] . "</td><td>" . $unknown_array[2][$i] . " " . $rs->form_hidden("unknownrows[]", $unknown_array[1][$i]) . "</td></tr>"; } $text .= "\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>"; } $text .= "\n\n\t\t\t" . $SPACER . "\n\t\t\t\n\t\t\t" . $ac->results_conversion_mainparent($content_mainarray, $review_mainarray, $article_mainarray) . "\n\t\t\t\n\t\t\t" . $SPACER . "\t\t\t\n\t\t\t\n\t\t\t<tr><td class='fcaption' colspan='2'>content : " . CONTENT_ADMIN_CONVERSION_LAN_27 . "</td></tr>\n\t\t\t" . $ac->results_conversion_row("content", $content_array, $totaloldrowsitem_content) . "\n\t\t\t\n\t\t\t" . $SPACER . "\t\t\t\n\t\t\t\n\t\t\t<tr><td class='fcaption' colspan='2'>review : " . CONTENT_ADMIN_CONVERSION_LAN_27 . "</td></tr>\n\t\t\t" . $ac->results_conversion_category("review", $review_cat_array, $totaloldrowscat_review) . "\n\t\t\t" . $ac->results_conversion_row("review", $review_array, $totaloldrowsitem_review) . "\n\t\t\t\n\t\t\t" . $SPACER . "\t\t\t\n\t\t\t\n\t\t\t<tr><td class='fcaption' colspan='2'>article : " . CONTENT_ADMIN_CONVERSION_LAN_27 . "</td></tr>\n\t\t\t" . $ac->results_conversion_category("article", $article_cat_array, $totaloldrowscat_article) . "\n\t\t\t" . $ac->results_conversion_row("article", $article_array, $totaloldrowsitem_article) . "\n\t\t\t\n\t\t\t" . $SPACER . "\n\t\t\t\n\t\t\t</table>"; $main_convert = array($caption, $text); } } } $text = ""; //update to 1.1 parent values to new style $upgrade_1_1 = FALSE; if ($thiscount = $sql->db_Select("pcontent", "*", "ORDER BY content_id ", "mode=no_where")) { while ($row = $sql->db_Fetch()) { if (strpos($row['content_parent'], ".") && substr($row['content_parent'], 0, 1) != "0") { //if item with old parent value exists, you need to upgrade to 1.1 $upgrade_1_1 = TRUE; } } } if ($upgrade_1_1 === TRUE) { $text .= $ac->upgrade_1_1(); } //upgrade to 1.2 table structure (add score, meta, layout fields) $text .= $ac->upgrade_1_2(); //upgrade to 1.21 (update content_author fields) $text .= $ac->upgrade_1_21(); //upgrade to 1.22 (update preference storage method)
include e_PLUGIN . "ebattles/include/revision.php"; // Plugin info ------------------------------------------------------------------------------------------------------- $eplug_name = EB_L1; $eplug_version = "{$majorRevision}.{$minorRevision}.{$revRevision}"; $eplug_author = "Frederic Marchais (qam4)"; $eplug_logo = ""; $eplug_url = "http://www.ebattles.net"; $eplug_email = "*****@*****.**"; $eplug_description = EB_L2; $eplug_compatible = "e107v0.7+"; $eplug_compliant = TRUE; // indicator if plugin is XHTML compliant, shows icon $eplug_readme = ""; // leave blank if no readme file $eb_SQL = new db(); $eb_SQL->db_Select("plugin", "plugin_version", "plugin_path='ebattles' AND plugin_installflag > 0"); list($eb_version_string) = $eb_SQL->db_Fetch(); $eb_version_string = preg_replace("/[a-zA-z\\s]/", '', $eb_version_string); $eb_version = explode('.', $eb_version_string, 3); // Name of the plugin's folder ------------------------------------------------------------------------------------- $eplug_folder = "ebattles"; // Name of menu item for plugin ---------------------------------------------------------------------------------- $eplug_menu_name = TRUE; // Name of the admin configuration file -------------------------------------------------------------------------- $eplug_conffile = "admin_config.php"; // Icon image and caption text ------------------------------------------------------------------------------------ $eplug_icon = $eplug_folder . "/images/ebattles_32.ico"; $eplug_icon_small = $eplug_folder . "/images/ebattles_16.ico"; //$eplug_caption = EB_L3; // List of preferences ----------------------------------------------------------------------------------------------- $eplug_prefs = array("eb_events_update_delay" => 60, "eb_events_update_delay_enable" => 0, "eb_mod_class" => e_UC_ADMIN, "eb_events_create_class" => e_UC_MEMBER, "eb_teams_create_class" => e_UC_MEMBER, "eb_media_submit_class" => e_UC_MEMBER, "eb_tab_theme" => 'default', "eb_max_image_size_check" => 1, "eb_max_image_size" => 16, "eb_default_items_per_page" => 25, "eb_max_avatar_size" => 32, "eb_avatar_enable_playersstandings" => 1, "eb_avatar_default_image" => 'anonymous.png', "eb_avatar_enable_teamsstandings" => 1, "eb_avatar_enable_teamslist" => 1, "eb_avatar_default_team_image" => 'default_group_avatar.png', "eb_links_menuheading" => EB_ADMIN_L29, "eb_activity_menuheading" => EB_ADMIN_L31, "eb_activity_number_of_items" => 10, "eb_activity_max_image_size_check" => 1, "eb_activity_max_image_size" => 16, "eb_disclaimer" => EB_ADMIN_L37, "eb_max_number_media" => 3, "eb_max_map_image_size_check" => 1, "eb_max_map_image_size" => 80, "eb_pm_notifications_class" => e_UC_MEMBER, "eb_email_notifications_class" => e_UC_NOBODY, "eb_links_showcreateevent" => 1, "eb_links_showcreateteam" => 1, "eb_links_showmatchsplayed" => 1, "eb_links_showmatchstoapprove" => 1, "eb_links_showmatchspending" => 1, "eb_links_showmatchesscheduled" => 1, "eb_links_showchallengesrequested" => 1, "eb_links_showchallengesunconfirmed" => 1, "eb_gold_active" => false, "eb_gold_userclass" => e_UC_ADMIN, "eb_gold_playmatch" => 0);
if ($_GET['delete_main_category'] == '2') { // Variable delete_main_category = 2 if answer equals Yes $MainCategoryId = $tp->toDB($_GET['main_category_id']); // Delete category from tables $sql->db_Delete(DB_TABLE_SHOP_MAIN_CATEGORIES, "main_category_id=" . intval($MainCategoryId)); header("Location: " . e_SELF); exit; } } } } } } // Build array with all images to choose from $sql = new db(); $sql->db_Select(DB_TABLE_SHOP_PREFERENCES); while ($row = $sql->db_Fetch()) { $store_image_path = $row['store_image_path']; $icon_width = $row['icon_width']; } require_once e_HANDLER . 'file_class.php'; $fl = new e_file(); if ($image_array = $fl->get_files(e_PLUGIN . "easyshop/" . $store_image_path, ".gif|.jpg|.png|.GIF|.JPG|.PNG", "standard", 2)) { sort($image_array); } if ($icon_width == '' or $icon_width < 1) { $icon_width = 16; } // Default of icon width is 16 pixels width // Edit or Maintain a single category if ($_GET['edit_main_category'] == 1) {
$text .= $rs->form_option($cap, "0", "", ""); $text .= $mains; $text .= $rs->form_select_close(); $text .= "<br />"; } else { $text .= $cap . "<br />"; $text .= $mains . "<br />"; } } //categories ------------------------ if (isset($linkspage_pref['link_menu_category']) && $linkspage_pref['link_menu_category']) { $mains = ""; $cap = isset($linkspage_pref['link_menu_category_caption']) && $linkspage_pref['link_menu_category_caption'] ? $linkspage_pref['link_menu_category_caption'] : LCLAN_OPT_83; $sqlc = new db(); $sql2 = new db(); if ($sqlc->db_Select("links_page_cat", "link_category_id, link_category_name, link_category_sef", "link_category_class REGEXP '" . e_CLASS_REGEXP . "' ORDER BY link_category_order")) { while ($rowc = $sqlc->fetch()) { if (isset($linkspage_pref['link_menu_category_amount']) && $linkspage_pref['link_menu_category_amount']) { $amount = $sql2->count("links_page", "(*)", "WHERE link_category = '" . $rowc['link_category_id'] . "' AND link_active = 1 AND link_class REGEXP '" . e_CLASS_REGEXP . "' "); $amount = "(" . $amount . ")"; } else { $amount = ""; } if (isset($linkspage_pref['link_menu_category_rendertype']) && $linkspage_pref['link_menu_category_rendertype'] == "1") { $mains .= $rs->form_option($rowc['link_category_name'] . " " . $amount, "0", e107::url('links_page', 'category', $rowc, 'full'), ""); } else { $mains .= $bullet . " <a href='" . e107::url('links_page', 'category', $rowc, 'full') . "'>" . $rowc['link_category_name'] . "</a> " . $amount . "<br />"; } } if (isset($linkspage_pref['link_menu_category_rendertype']) && $linkspage_pref['link_menu_category_rendertype'] == "1") { $selectjs = "style='width:100%;' onchange=\"if(this.options[this.selectedIndex].value != ''){ return document.location=this.options[this.selectedIndex].value; }\" ";
$action = $tmp[0]; // e.g. $action = 'edit' $action_id = $tmp[1]; // e.g. $action_id = '5' $page_id = $tmp[2]; // e.g. $page_id = '3' (not used in admin_discounts) unset($tmp); // unset the arrays, so next time URL query will be determined as new } // Include userclass_class.php which is necessary for function r_userclass (dropdown of classes) require_once e_HANDLER . 'form_handler.php'; require_once e_HANDLER . 'userclass_class.php'; require_once e_HANDLER . 'file_class.php'; // Define actual currency and position of currency character once $sql = new db(); $sql->db_Select(DB_TABLE_SHOP_CURRENCY, "*", "currency_active=2"); if ($row = $sql->db_Fetch()) { $unicode_character = $row['unicode_character']; $paypal_currency_code = $row['paypal_currency_code']; } // Get some settings from preference table $sql->db_Select(DB_TABLE_SHOP_PREFERENCES, "*", "store_id=1"); if ($row = $sql->db_Fetch()) { $set_currency_behind = $row['set_currency_behind']; $print_discount_icons = $row['print_discount_icons']; } // Determine currency before or after amount if ($set_currency_behind == 1) { // Print currency after amount $unicode_character_before = ""; $unicode_character_after = " " . $unicode_character;
$start_year = date("Y", $first_post['news_datestamp']); $end_year = $cur_year; // ---------------------- // build the yearselector // ---------------------- $year_selector = "<div class='forumheader' style='text-align: center; margin-bottom: 2px;'>"; $year_selector .= "" . BLOGCAL_ARCHIV1 . ": <select name='activate' onchange='urljump(this.options[selectedIndex].value)' class='tbox'>\n"; for ($i = $start_year; $i <= $end_year; $i++) { $start = mktime(0, 0, 0, 1, 1, intval($req_year)); $end = mktime(23, 59, 59, 12, 31, intval($req_year)); // create the option entry $year_link = $prefix . "/archive.php?year." . $i; $year_selector .= "<option value='" . $year_link . "'"; if ($i == $req_year) { $year_selector .= " selected='selected'"; if ($bcSql->db_Select("news", "news_id, news_datestamp, news_class", "news_datestamp > {$start} AND news_datestamp < {$end}")) { while ($news = $bcSql->db_Fetch()) { if (check_class($news['news_class'])) { list($xmonth, $xday) = explode(" ", date("n j", $news['news_datestamp'])); if (!$day_links[$xmonth][$xday]) { $day_links[$xmonth][$xday] = e107::getUrl()->create('news/list/day', 'id=' . formatDate($req_year, $xmonth, $xday)); } } } } } $year_selector .= ">" . $i . "</option>\n"; } $year_selector .= "</select>\n</div>"; // -------------------------- // create the archive display
function sc_admin_nav($parm) { if (ADMIN) { global $ns, $pref, $array_functions, $tp; $e107_var = array(); if (strstr(e_SELF, '/admin.php')) { $active_page = 'x'; } else { $active_page = time(); } $e107_var['x']['text'] = ADLAN_52; $e107_var['x']['link'] = e_ADMIN_ABS . 'admin.php'; $e107_var['y']['text'] = ADLAN_53; $e107_var['y']['link'] = e_HTTP . "index.php"; //$text .= show_admin_menu("",$active_page,$e107_var); $e107_var['afuncs']['text'] = ADLAN_93; $e107_var['afuncs']['link'] = ''; /* SUBLINKS */ $tmp = array(); foreach ($array_functions as $links_key => $links_value) { $tmp[$links_key]['text'] = $links_value[1]; $tmp[$links_key]['link'] = $links_value[0]; } $e107_var['afuncs']['sub'] = $tmp; /* SUBLINKS END */ // Plugin links menu $xml = e107::getXml(); $xml->filter = array('@attributes' => FALSE, 'administration' => FALSE); // .. and they're all going to need the same filter $nav_sql = new db(); if ($nav_sql->db_Select('plugin', '*', 'plugin_installflag=1')) { $tmp = array(); $e107_var['plugm']['text'] = ADLAN_95; $e107_var['plugm']['link'] = ''; /* SUBLINKS */ //Link Plugin Manager $tmp['plugm']['text'] = '<strong>' . ADLAN_98 . '</strong>'; $tmp['plugm']['link'] = e_ADMIN . 'plugin.php'; $tmp['plugm']['perm'] = 'P'; while ($rowplug = $nav_sql->db_Fetch()) { $plugin_id = $rowplug['plugin_id']; $plugin_path = $rowplug['plugin_path']; if (is_readable(e_PLUGIN . $plugin_path . '/plugin.xml')) { $readFile = $xml->loadXMLfile(e_PLUGIN . $plugin_path . '/plugin.xml', true, true); // e107::loadLanFiles($plugin_path, 'admin'); $eplug_caption = $tp->toHTML($readFile['@attributes']['name'], FALSE, 'defs, emotes_off'); $eplug_conffile = $readFile['administration']['configFile']; } elseif (is_readable(e_PLUGIN . $plugin_path . '/plugin.php')) { include e_PLUGIN . $plugin_path . '/plugin.php'; } // Links Plugins if ($eplug_conffile) { $tmp['plug_' . $plugin_id]['text'] = $eplug_caption; $tmp['plug_' . $plugin_id]['link'] = e_PLUGIN . $plugin_path . '/' . $eplug_conffile; $tmp['plug_' . $plugin_id]['perm'] = 'P' . $plugin_id; } unset($eplug_conffile, $eplug_name, $eplug_caption); } $e107_var['plugm']['sub'] = $tmp; $e107_var['plugm']['sort'] = true; /* SUBLINKS END */ //$text .= show_admin_menu(ADLAN_95, time(), $e107_var, FALSE, TRUE, TRUE); unset($tmp); } $e107_var['lout']['text'] = LAN_LOGOUT; $e107_var['lout']['link'] = e_ADMIN_ABS . 'admin.php?logout'; $text = e_admin_menu('', '', $e107_var); return $ns->tablerender(LAN_HEADER_01, $text, array('id' => 'admin_nav', 'style' => 'button_menu'), TRUE); } }
function show_ipn_checkout($p_session_id) { // Parameter $p_session_id is used to check the users' current session ID to prevent XSS vulnarabilities //if ($p_session_id != session_id()) { // Get out of here: incoming session id is not equal than current session id // header("Location: ".e_BASE); // Redirect to the home page // exit(); //} // Check query if (e_QUERY) { $tmp = explode(".", e_QUERY); $action = $tmp[0]; unset($tmp); } $sql2 = new db(); $sql2->db_Select(DB_TABLE_SHOP_PREFERENCES, "*", "store_id=1"); while ($row2 = $sql2->db_Fetch()) { $sandbox = $row2['sandbox']; $paypal_email = $row2['paypal_email']; $payment_page_style = $row2['payment_page_style']; $paypal_currency_code = $row2['paypal_currency_code']; $set_currency_behind = $row2['set_currency_behind']; $minimum_amount = intval($row2['minimum_amount']); $always_show_checkout = $row2['always_show_checkout']; $email_order = $row2['email_order']; } $sql3 = new db(); $sql3->db_Select(DB_TABLE_SHOP_CURRENCY, "*", "currency_active=2"); while ($row3 = $sql3->db_Fetch()) { $unicode_character = $row3['unicode_character']; $paypal_currency_code = $row3['paypal_currency_code']; } // Determine currency before or after amount if ($set_currency_behind == 1) { // Print currency after amount $unicode_character_before = ""; $unicode_character_after = " " . $unicode_character; } else { $unicode_character_before = " " . $unicode_character . " "; $unicode_character_after = ""; // Print currency before amount in all other cases } if ($sandbox == 2) { $paypalDomain = "https://www.sandbox.paypal.com"; } else { $paypalDomain = "https://www.paypal.com"; } // Display check out button // <form target='_blank' action='$paypalDomain/cgi-bin/webscr' method='post'> leads to XHTML incompatible caused by target $f_text .= "\r\n \t<form action='{$paypalDomain}/cgi-bin/webscr' method='post'>\r\n\t\t<div>\r\n\t\t\t<input type='hidden' name='cmd' value='_xclick' />\r\n\t\t\t<input type='hidden' name='upload' value='1' />\r\n\t\t\t<input type='hidden' name='business' value='{$paypal_email}' />\r\n\t\t\t<input type='hidden' name='page_style' value='{$payment_page_style}' />"; // Fill the Cart with products from the basket $count_items = count($_SESSION['shopping_cart']); // Count number of different products in basket $array = $_SESSION['shopping_cart']; // PayPal requires to pass multiple products in a sequence starting at 1 $cart_count = 1; // Set thanks page to correct value $thanks_page = str_replace('easyshop.php', 'thank_you.php', e_SELF); $cancel_page = str_replace('easyshop.php', 'cancelled.php', e_SELF); $ipn_notify_page = str_replace('easyshop.php', 'ipn_notify.php', e_SELF); // For each product in the shopping cart array write PayPal details foreach ($array as $id => $item) { $f_text .= "\r\n\t\t\t<input type='hidden' name='item_name_" . $cart_count . "' value='" . $item['item_name'] . "' />\r\n\t\t\t<input type='hidden' name='item_number_" . $cart_count . "' value='" . $item['sku_number'] . "' />\r\n\t\t\t<input type='hidden' name='amount_" . $cart_count . "' value='" . $item['item_price'] . "' />\r\n\t\t\t<input type='hidden' name='quantity_" . $cart_count . "' value='" . $item['quantity'] . "' />\r\n\t\t\t<input type='hidden' name='shipping_" . $cart_count . "' value='" . $item['shipping'] . "' />\r\n\t\t\t<input type='hidden' name='shipping2_" . $cart_count . "' value='" . $item['shipping2'] . "' />\r\n\t\t\t<input type='hidden' name='handling_" . $cart_count . "' value='" . $item['handling'] . "' />\r\n\t\t\t<input type='hidden' name='db_id_" . $cart_count . "' value='" . $item['db_id'] . "' />"; $cart_count++; } $f_text .= "\r\n <input type='hidden' name='currency_code' value='{$paypal_currency_code}' />\r\n <input type='hidden' name='no_note' value='1' />\r\n <input type='hidden' name='lc' value='US' />\r\n <input type='hidden' name='bn' value='PP-ShopCartBF' />\r\n <input type='hidden' name='rm' value='1' />\r\n <input type='hidden' name='notify_url' value='{$ipn_notify_page}' />\r\n <input type='hidden' name='return' value='" . $thanks_page . "' />\r\n <input type='hidden' name='cancel_return' value='" . $cancel_page . "' />\r\n "; if (USER) { // If user is logged in we also include the user id $f_text .= "<input type='hidden' name='custom' value='" . USERID . "' />"; } if ($email_order == 0) { // in case setting always show checkout button is off if ($always_show_checkout == 0) { // When there are items in the shopping cart, display 'Go to checkout' button if ($_SESSION['sc_total']['items'] > 0) { // Only show 'Go to checkout' if total amount is above minimum amount if ($_SESSION['sc_total']['sum'] > $minimum_amount) { $f_text .= "\r\n <input class='button' type='submit' value='" . EASYSHOP_SHOP_09 . "'/>\r\n </div>\r\n \t\t\t\t\t</form>\r\n \t\t\t\t\t<br />"; } else { // Minimum amount has not been reached; inform the shopper $f_text .= EASYSHOP_SHOP_36 . " : " . $unicode_character_before . number_format($minimum_amount, 2, '.', '') . $unicode_character_after . " <br />\r\n " . EASYSHOP_SHOP_37 . " : " . $unicode_character_before . number_format($minimum_amount - $_SESSION['sc_total']['sum'], 2, '.', '') . $unicode_character_after . " <br />"; } } } else { // RC6 Fix for proper closing the form tag $f_text .= "</div></form><br />"; } } else { // e-mail the order to admin $f_text .= "<a class='button' href='function MailOrder({$array})'>" . EASYSHOP_SHOP_79 . "</a></form><br />"; } // in case setting always display checkout button is on //else if ($always_show_checkout == 1) { $f_text .= "\r\n\t\t\t<input class='button' type='submit' value='" . EASYSHOP_SHOP_09 . "'/>\r\n \t\t\t</form>\r\n \t\t\t<br />"; } // Show 'Manage your basket link' if ($_SESSION['sc_total']['items'] > 0 and $action != "edit") { $f_text .= "\r\n <div style='text-align:center;'><a href='easyshop.php?edit'>" . EASYSHOP_SHOP_35 . "</a></div>\r\n \t"; } else { $f_text .= "\r\n\t\t</div>\r\n\t\t</form>\r\n\t\t<br />"; } /* // Some debug info print_r($_SESSION['shopping_cart']); print ("<br />"); print_r($_SESSION['sc_total']); print ("<br />"); print_r($_SESSION['sc_total']['shipping']); print ("<br />"); print_r($_SESSION['sc_total']['shipping2']); print ("<br />"); print_r($_SESSION['sc_total']['handling']); print ("<br />"); */ return $f_text; }
function print_item_pdf($id) { global $tp, $pref, $content_shortcodes; global $CONTENT_PRINT_IMAGES, $row, $content_image_path, $content_pref, $mainparent; //in this section you decide what to needs to be output to the pdf file $con = new convert(); require_once e_PLUGIN . "content/content_shortcodes.php"; require_once e_PLUGIN . "content/handlers/content_class.php"; $aa = new content(); if (!is_object($sql)) { $sql = new db(); } $sql->db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_image, content_author, content_parent, content_datestamp, content_class, content_pref", "content_id='" . intval($id) . "' "); $row = $sql->db_Fetch(); if (!check_class($row['content_class'])) { header("location:" . e_PLUGIN . "content/content.php"); exit; } $authordetails = $aa->getAuthor($row['content_author']); $row['content_datestamp'] = $con->convert_date($row['content_datestamp'], "long"); $img = $tp->parseTemplate('{CONTENT_PRINT_IMAGES}', FALSE, $content_shortcodes); $mainparent = $aa->getMainParent(intval($id)); $content_pref = $aa->getContentPref($mainparent); $content_icon_path = $tp->replaceConstants($content_pref["content_icon_path"]); $content_image_path = $tp->replaceConstants($content_pref["content_image_path"]); $img = $tp->parseTemplate('{CONTENT_PDF_IMAGES}', FALSE, $content_shortcodes); //add custom and preset tags if present $custom = e107::unserialize($row['content_pref']); //$custom = $eArrayStorage->ReadxxxArray($row['content_pref']); $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11); $CONTENT_CONTENT_TABLE_CUSTOM_TAGS = ""; if (!empty($custom)) { foreach ($custom as $k => $v) { if ($k == "content_custom_presettags") { if (isset($content_pref["content_content_presettags"]) && $content_pref["content_content_presettags"]) { foreach ($v as $ck => $cv) { if (is_array($cv)) { //date if (!($cv['day'] == "" && $cv['month'] == "" && $cv['year'] == "")) { $vv = $cv['day'] . " " . $months[$cv['month'] - 1] . " " . $cv['year']; } } else { $vv = $cv; } if (isset($ck) && $ck != "" && isset($vv) && $vv != "") { $CUSTOM_TAGS = TRUE; $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($ck, true); $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($vv, true); $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY . " : " . $CONTENT_CONTENT_TABLE_CUSTOM_VALUE . "<br />"; } } } } else { if (isset($content_pref["content_content_customtags"]) && $content_pref["content_content_customtags"]) { $key = substr($k, 15); if (isset($key) && $key != "" && isset($v) && $v != "") { $CUSTOM_TAGS = TRUE; $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($key, true); $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($v, true); $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY . " : " . $CONTENT_CONTENT_TABLE_CUSTOM_VALUE . "<br />"; } } } } } $text = "\n\t<b>" . $row['content_heading'] . "</b><br />\n\t" . $row['content_subheading'] . "<br />\n\t" . $authordetails[1] . ", " . $row['content_datestamp'] . "<br />\n\t<br />\n\t" . $row['content_text'] . "<br />\n\t" . ($CONTENT_CONTENT_TABLE_CUSTOM_TAGS ? $CONTENT_CONTENT_TABLE_CUSTOM_TAGS : "") . "\n\t<div style='float:left; padding-left:10px;'>" . $img . "</div>\n\t"; //the following defines are processed in the document properties of the pdf file //Do NOT add parser function to the variables, leave them as raw data ! //as the pdf methods will handle this ! $text = $text; //define text $creator = SITENAME; //define creator $author = $authordetails[1]; //define author $title = $row['content_heading']; //define title $subject = $row['content_subheading']; //define subject $keywords = ""; //define keywords //define url to use in the header of the pdf file $url = SITEURLBASE . e_PLUGIN_ABS . "content/content.php?content." . $row['content_id']; //always return an array with the following data: return array($text, $creator, $author, $title, $subject, $keywords, $url); }
function rssadminimport() { $sql = e107::getDb(); $ns = e107::getRender(); $mes = e107::getMessage(); $tp = e107::getParser(); global $i, $rss_shortcodes, $feed, $pref; global $RSS_ADMIN_IMPORT_HEADER, $RSS_ADMIN_IMPORT_TABLE, $RSS_ADMIN_IMPORT_FOOTER; $sqli = new db(); $feedlist = array(); // News $feed['name'] = ADLAN_0; $feed['url'] = 'news'; // The identifier for the rss feed url $feed['topic_id'] = ''; // The topic_id, empty on default (to select a certain category) $feed['path'] = 'news'; // This is the plugin path location $feed['text'] = RSS_PLUGIN_LAN_7; $feed['class'] = '0'; $feed['limit'] = '9'; $feedlist[] = $feed; // News categories if ($sqli->db_Select("news_category", "*", "category_id!='' ORDER BY category_name ")) { while ($rowi = $sqli->db_Fetch()) { $feed['name'] = ADLAN_0 . ' > ' . $rowi['category_name']; $feed['url'] = 'news'; $feed['topic_id'] = $rowi['category_id']; $feed['path'] = 'news'; $feed['text'] = RSS_PLUGIN_LAN_10 . ' ' . $rowi['category_name']; $feed['class'] = '0'; $feed['limit'] = '9'; // $feed['exclude_class'] = ''; $feedlist[] = $feed; } } /* // Download $feed['name'] = ADLAN_24; $feed['url'] = 'download'; $feed['topic_id'] = ''; $feed['path'] = 'download'; $feed['text'] = RSS_PLUGIN_LAN_8; $feed['class'] = '0'; $feed['limit'] = '9'; $feedlist[] = $feed; // Download categories if($sqli -> db_Select("download_category", "*","download_category_id!='' ORDER BY download_category_order ")) { while($rowi = $sqli -> db_Fetch()) { $feed['name'] = ADLAN_24.' > '.$rowi['download_category_name']; $feed['url'] = 'download'; $feed['topic_id'] = $rowi['download_category_id']; $feed['path'] = 'download'; $feed['text'] = RSS_PLUGIN_LAN_11.' '.$rowi['download_category_name']; $feed['class'] = '0'; $feed['limit'] = '9'; $feedlist[] = $feed; } } */ // Comments $feed['name'] = LAN_COMMENTS; $feed['url'] = 'comments'; $feed['topic_id'] = ''; $feed['path'] = 'comments'; $feed['text'] = RSS_PLUGIN_LAN_9; $feed['class'] = '0'; $feed['limit'] = '9'; $feedlist[] = $feed; // Plugin rss feed, using e_rss.php in plugin folder $plugin_feedlist = array(); foreach ($pref['e_rss_list'] as $val) { $eplug_rss_feed = array(); if (is_readable(e_PLUGIN . $val . "/e_rss.php")) { require_once e_PLUGIN . $val . "/e_rss.php"; $className = $val . "_rss"; $data = false; if (!($data = e107::callMethod($className, 'config'))) { $data = $eplug_rss_feed; } foreach ($data as $v) { $v['path'] = $val; array_push($plugin_feedlist, $v); } } } $feedlist = array_merge($feedlist, $plugin_feedlist); // print_a($feedlist); $render = FALSE; $i = 0; $text = $RSS_ADMIN_IMPORT_HEADER; foreach ($feedlist as $k => $feed) { $feed['topic_id'] = $tp->toDB($feed['topic_id']); $feed['url'] = $tp->toDB($feed['url']); // Check if feed is not yet present if (!$sql->select("rss", "*", "rss_path='" . $feed['path'] . "' AND rss_url='" . $feed['url'] . "' AND rss_topicid='" . $feed['topic_id'] . "' ")) { $render = TRUE; $text .= $tp->parseTemplate($RSS_ADMIN_IMPORT_TABLE, FALSE, $rss_shortcodes); $i++; } } $text .= $tp->parseTemplate($RSS_ADMIN_IMPORT_FOOTER, FALSE, $rss_shortcodes); if (!$render) { $this->show_message(RSS_LAN_ADMIN_11, RSS_LAN_ERROR_6); } else { $ns->tablerender(RSS_LAN_ADMIN_11, $mes->render() . $text); } }
function view_faq($idx) { global $ns, $row, $sql, $aj, $pref, $cobj, $id, $tp, $FAQ_VIEW_TEMPLATE; //require_once (e_PLUGIN."faqs/faqs_shortcodes.php"); $sc = e107::getScBatch('faqs', TRUE); $sql->db_Select("faqs", "*", "faq_id='{$idx}' LIMIT 1"); $row = $sql->db_Fetch(); $sc->setVars($row); $caption = " FAQ #" . $row['faq_id']; $text = $tp->parseTemplate($FAQ_VIEW_TEMPLATE, true); // $text = $tp->toHTML($text, TRUE); $ret['text'] = $text; $ret['caption'] = $caption; $ret['title'] = $row['faq_question']; $ret['comments'] = $text; return $ret; $subject = !$subject ? $aj->formtpa($faq_question) : $subject; if (check_class($row['faq_comment'])) { $action = "comment"; $table = "faq"; $query = $pref['nested_comments'] ? "comment_item_id='{$idx}' AND (comment_type='{$table}' OR comment_type='3') AND comment_pid='0' ORDER BY comment_datestamp" : "comment_item_id='{$idx}' AND (comment_type='{$table}' OR comment_type='3') ORDER BY comment_datestamp"; unset($text); if (!is_object($sql2)) { $sql2 = new db(); } if ($comment_total = $sql2->db_Select("comments", "*", $query)) { $width = 0; while ($row = $sql2->db_Fetch()) { if ($pref['nested_comments']) { $text = $cobj->render_comment($row, $table, $action, $idx . "." . $id, $width, $subject); $ns->tablerender(FAQLAN_38, $text); } else { $text .= $cobj->render_comment($row, $table, $action, $idx . "." . $id, $width, $subject); } } if (!$pref['nested_comments']) { $ns->tablerender(LAN_COMMENTS, $text); } if (ADMIN && getperms("B")) { // bkwon 05-Jun-2004 fix URL to moderate comment echo "<div style='text-align:right'><a href='" . e_ADMIN . "modcomment.php?faq.{$faq_id}'>moderate comments</a></div><br />"; } } $cobj->form_comment($action, $table, $idx . "." . $id, $subject, $content_type); } // end of check_class }