#1
|
||||
|
||||
![]() [IMG][/IMG] بسم الله الرحمن الرحيم وبه نستعين وبالصلاه والسلام علي اشرف المرسلين اما بعد طبعاً من اكثر من 3 اسابيع اصدرت احدث نسخة لسكربت اونكارد المشهور وهي 2.4.1 Arcade script - onArcade.com وانا اليوم بس سويت الترقية ههههه بعد ماخلصت قلت خليني افيد باقي الاعضاء بملفات الترقية جاهزة + طريقة الترقية لمن اراد ان يعملها بنفسه .. مع العلم طريقة الترقية هي من مصمم السكربت نفسه وليس من عندي .. انا فقط بنقلهآ لكم . :bleh: وهذا الشرح خاص بالاشخاص الي مرخصين السكربت .. لانه اخر اصدار مدفوع فقط وليس للاصدارات المجانية مثل 2.3.0 و 2.3.2 وغيرهآ ~ يلا نبدأ على بركة الله .. 1- طريقة الترقية بملفات الترقية الجاهزة بدون اي تعديلات . - الي حاب يرقي عالسريع المطلوب كالتالي : 1- يحمل نسخة السكربت الجديدة بعضويته بموقع اونكارد الرسمي وهي النسخة 2.4.1 2- بعد التحميل وفك الضغط يقوم برفع هذه الملفات الى موقعه مع الموافقة على الاستبدال : رمز Code: feed_downloader.php includes/errors.php includes/file_type/Iframe.php includes/file_type/Unity.php includes/image.php includes/send_mail.php includes/submitscore.php includes/version.php jscripts/unityobject.js طبعا كل ملف في مجلده الخاص به .. 3- بعد رفع الملفات .. اذهب الى المرفقات وقم بتحميل الملف المرفق وفك الضغط عنه . وستجد مفكرة فيها التعليمات لاستكمال عملية الترقية ( باختصار هي ملفات اخرى تقوم برفعها كل ملف في مجلده الخاص ) . وبس تكون عملية الترقية اكتملت عندك بكل بساطة ~ 2- الطريقة الثانية وهي الترقية خطوة بـ خطوة . اول خطوة تقوم بعملها هي بتحميل السكربت اخر اصدار من الموقع الرسمي بعضويتك .. وتقوم برفع الملفات المذكورة اعلاه بالطريقة رقم 1 . - ملاحظة هامة عند عمل التعديلات على الملفات يرجى عدم استخدام برنامج النوت باد الموجود بالويندوز لديك لانه سيحدث خطأ ولن يعمل السكربت لديك . يرجى استخدام اي برنامج تحرير نصوص .. مثآل برنامج انا استخدمه سهل جداً وهو مثل النوت باد : Notepad++ Home الان بعد تحميل برنامج وتثبيته ، رح نقوم بتعديلات ملفات كثيرة وهذه اسمائهآ قبل نبدأ كاملة : رمز Code: browse.php cup.php links.php search.php sponsor.php admin/ads.php admin/config.php admin/files.php admin/index.php includes/admin_functions.php includes/functions.php jscripts/global.js jscripts/profile.js templates/onarcade/file.php templates/onarcade/usercp.php نبدا بالملفات الأولى كالتالي : - في ملف browse.php .. نغير : رمز Code: $file['stars'] = round((int) $file['rating']); الى رمز Code: $file['stars'] = round($file['rating']); وأيضاً في نفس الملف نغير : رمز Code: $template->add_keywords($category['keywords']); الى رمز Code: $template->add_keywords(nohtml($category['keywords'])); - في ملف cup.php .. نغير : رمز Code: $cup_query = mysql_query("SELECT c.cup_id, c.name, u.userid user_id, u.username, GROUP_CONCAT(f.title ORDER BY f.title ASC SEPARATOR ', ') AS games الى رمز Code: $cup_query = mysql_query("SELECT c.cup_id, c.name, u.userid user_id, u.username, GROUP_CONCAT(DISTINCT f.title ORDER BY f.title ASC SEPARATOR ', ') AS games - في ملف links.php .. نغير : رمز Code: 'status' => '1' الى رمز Code: 'status' => '0' في ملف search.php .. نغير : رمز Code: $file['stars'] = round((int) $file['rating']); الى رمز Code: $file['stars'] = round($file['rating']); - في ملف sponsor.php .. نغير : رمز Code: $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen (PAYPAL_DOMAIN, 80, $errno, $errstr, 30); الى رمز Code: $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Host: ". PAYPAL_DOMAIN ."\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen('ssl://'. PAYPAL_DOMAIN, 443, $errno, $errstr, 30); - في ملف admin/ads.php .. نحذف : رمز Code: $ad['code'] = nohtml($ad['code']); - في ملف admin/config.php .. نغير : رمز Code: // change commas into separator function replace_commas($string, $tag = '|') { $string = preg_replace('#\s*,\s*#s', $tag, trim($string)); $tag = str_replace('|', '\\|', $tag); $string = preg_replace('#(^'. $tag .'|'. $tag .'$)#', '', $string); return $string; } // change separators into comas function insert_commas($string, $tag = '|') { return str_replace($tag, ', ', $string); } الى رمز Code: // change commas into separator function replace_commas($string, $tag = '|', $preg_quote = false) { if ($preg_quote) { $string = preg_quote($string, '#'); } $string = preg_replace('#\s*,\s*#s', $tag, trim($string)); $tag = str_replace('|', '\\|', $tag); $string = preg_replace('#(^'. $tag .'|'. $tag .'$)#', '', $string); return $string; } // change separators into comas function insert_commas($string, $tag = '|') { return preg_replace('#([^\\\\](\\\\\\\\)*)'. preg_quote($tag, '#') .'#', '$1, ', $string); } // Remove preg_quote-s function preg_unquote($string, $delimiter = null) { $characters = array('.', '\\', '+', '*', '?', '[', '^', ']', '$', '(', ')', '{', '}', '=', '!', '', '|', ':', '-'); if (!empty($delimiter)) { $characters[] = $delimiter; } foreach ($characters as $character) { $string = str_replace('\\'. $character, $character, $string); } return $string; } وأيضاً في نفس الملف نغير : رمز Code: $separate = array('banned_ip', 'comments_banned_ip', 'bad_words', 'submit_valid_file', 'submit_valid_image'); الى رمز Code: $separate = array('banned_ip', 'comments_banned_ip', 'submit_valid_file', 'submit_valid_image'); $separate_preg_quote = array('bad_words'); وفي نفس الملف ايضاً نبحث عن : رمز Code: $settings[$var] = replace_commas(get_without_slashes($var)); ونضيف بعدهآ : رمز Code: } elseif (in_array($var, $separate_preg_quote)) { $settings[$var] = replace_commas(get_without_slashes($var), '|', true); وايضاً في نفس الملف نغير : رمز Code: $settings['bad_words'] = insert_commas($settings['bad_words']); الى رمز Code: $settings['bad_words'] = preg_unquote(insert_commas($settings['bad_words']), '#'); وايضاً في نفس الملف نغير : رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=240&'. $url)) { الى رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=241&'. $url)) { وايضاً في نفس الملف نغير : رمز Code: $settings['bad_words'] = insert_commas($settings['bad_words']); الى رمز Code: $settings['bad_words'] = preg_unquote(insert_commas($settings['bad_words']), '#'); - والآن في ملف admin/files.php .. نغير : رمز Code: $files_query = mysql_query("SELECT file, icon, filelocation, iconlocation, filetype FROM ". $tbl_prefix ."files WHERE fileid IN (". implode(', ', $files) .")"); الى رمز Code: $files_query = mysql_query("SELECT file, icon, filelocation, iconlocation, filetype, score_name FROM ". $tbl_prefix ."files WHERE fileid IN (". implode(', ', $files) .")"); وفي نفس الملف نبحث عن : رمز Code: if (strlen($files_row['icon']) > 3 && $files_row['iconlocation'] == 1) { @unlink('./files/image/'. $files_row['icon']); } ونضيف بعدهآ : رمز Code: // delete gamedata files if (strlen($files_row['score_name']) > 0 && !in_array($files_row['score_name'], array('.', '..')) && file_exists('./arcade/gamedata/'. $files_row['score_name'])) { recursive_rmdir('./arcade/gamedata/'. $files_row['score_name']); } وفي نفس الملف نغير : رمز Code: delete_table_row('favorite', 'file_id IN ('. $files_string .')'); delete_table_row('plugs', 'file_id IN ('. $files_string .')'); الى رمز Code: delete_table_rows('favorite', 'file_id IN ('. $files_string .')'); delete_table_rows('plugs', 'file_id IN ('. $files_string .')'); وايضاً في نفس الملف نغير : رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=230&'. $url)) { الى رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=241&'. $url)) { وفي نفس الملف نغير : رمز Code: case 'feed_game': if (isset($_GET['rating'])) { $url = 'a=feed_game_rate&id='. (int) $_GET['id'] .'&rating='. ($_GET['rating'] == 1 ? 1 : 0) .'&key='. urlencode(base64_encode($license_key)) .'&url='. urlencode(base64_encode($_SERVER['SERVER_NAME'])); if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=230&'. $url)) { $template->error($lang['on_connection_failed']); } echo $content; } elseif (isset($_GET['id'])) { $game_id = (int) $_GET['id']; $url = 'a=feed_game&id='. $game_id .'&key='. urlencode(base64_encode($license_key)) .'&url='. urlencode(base64_encode($_SERVER['SERVER_NAME'])) .'&lang='. $settings['language'] .'&image='. get_image_size_type(); if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=230&'. $url)) { $template->error($lang['on_connection_failed']); } $content = json_array($content); if ($content['error'] != 0) { $template->error($lang['no_page_found']); } $content['game']['category'] = get_real_category($content['game']['category']); $content['game']['file'] = $content['game']['file']; $return = array( 'error' => false, 'game' => &$content['game'] ); // check if file exists $file = get_file_name_from_url($return['game']['file'], 'invalid'); if (file_exists($files_dir . $file['name']) || count_table_rows('files', 'title LIKE \''. escape_string($return['game']['title'], false) .'\'') > 0) { $return['message'] = $lang['file_exists']; } $template->json($return); } else { // download and submit new game into database $file_url = get_without_slashes('file'); $image_url = get_without_slashes('image'); if (strlen($_POST['title']) == 0) { $template->json_error($lang['title_blank']); } $image = get_file_name_from_url($image_url, 'png'); $file = get_file_name_from_url($file_url, $_POST['file_type']); $image = $file['no_extension'] .'.'. $image['type']; $file = $file['name']; // make sure file names are unique while (file_exists($files_dir . $file) || file_exists($images_dir . $image)) { $suva = rand(0,9); $file = $suva . $file; $image = $suva . $image; } // download files if (!copy_file($file_url, $files_dir . $file) || !copy_file($image_url, $images_dir . $image)) { $template->json_error($lang['not_download']); } // resize image include('./includes/image.php'); $resize_image = new image($images_dir . $image); $resize_image->resize($settings['image_width'], $settings['image_height']); mysql_query("INSERT INTO ". $tbl_prefix ."files (file, icon, filelocation, iconlocation, title, description, keywords, width, height, category, status, filetype, dateadded, added_by, adult, scores, score_type, score_name, customcode) VALUES ('". escape_string($file, false) ."', '". escape_string($image, false) ."', '1', '1', '". $_POST['title'] ."', '". $_POST['description'] ."', '". $_POST['keywords'] ."', ". (int) $_POST['width'] .", ". (int) $_POST['height'] .", ". (int) $_POST['category'] .", ". (int) $_POST['status'] .", '". $_POST['file_type'] ."', ". TIME_NOW .", ". $session->user_id .", '". (int) $_POST['adult'] ."', '". (int) $_POST['scores'] ."', '". (int) $_POST['score_type'] ."', '". $_POST['score_name'] ."', '')"); if ($_POST['status'] == 1) { update_stats('total_files', 1); } clear_cache(array('main_0', 'main_1', 'menu_lists')); $template->json(array('error' => false, 'message' => $lang['added'])); } break; الى رمز Code: case 'feed_game': if (isset($_GET['rating'])) { $url = 'a=feed_game_rate&id='. (int) $_GET['id'] .'&rating='. ($_GET['rating'] == 1 ? 1 : 0) .'&key='. urlencode(base64_encode($license_key)) .'&url='. urlencode(base64_encode($_SERVER['SERVER_NAME'])); if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=241&'. $url)) { $template->error($lang['on_connection_failed']); } echo $content; } elseif (isset($_GET['id'])) { $game_id = (int) $_GET['id']; $url = 'a=feed_game&id='. $game_id .'&key='. urlencode(base64_encode($license_key)) .'&url='. urlencode(base64_encode($_SERVER['SERVER_NAME'])) .'&lang='. $settings['language'] .'&image='. get_image_size_type(); if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=241&'. $url)) { $template->error($lang['on_connection_failed']); } $content = json_array($content); if ($content['error'] != 0) { $template->error($lang['no_page_found']); } $content['game']['category'] = get_real_category($content['game']['category']); $content['game']['file'] = $content['game']['file']; $return = array( 'error' => false, 'game' => &$content['game'] ); // check if file exists $file_name = get_game_feed_file_name($return['game']['id'], get_file_extension($return['game']['file'])); if (file_exists($files_dir . $file_name) || count_table_rows('files', 'title LIKE \''. mysql_real_escape_string($return['game']['title']) .'\'') > 0) { $return['message'] = $lang['file_exists']; } $template->json($return); } else { // download and submit new game into database $file_url = get_without_slashes('file'); $image_url = get_without_slashes('image'); $file_id = (int) $_POST['id']; if (strlen($_POST['title']) == 0) { $template->json_error($lang['title_blank']); } $file_type = get_file_extension($file_url); if ($file_type === '') { $file_type = strtolower($_POST['file_type']); } $file_name = get_game_feed_file_name($file_id, $file_type); $image_type = get_file_extension($image_url); if (strlen($image_type) == 0) { $image_type = 'png'; } $image_name = get_game_feed_file_name($file_id, $image_type); // make sure file names are unique while (file_exists($files_dir . $file_name) || file_exists($images_dir . $image_name)) { $suva = rand(0,9); $file_name = $suva . $file_name; $image_name = $suva . $image_name; } if ($_POST['file_linked'] == 1) { // use linked file instead $file_name = $file_url; $file_location = 2; } else { // download files if (!copy_file($file_url, $files_dir . $file_name)) { $template->json_error($lang['not_download']); } $file_location = 1; } // download image if (!copy_file($image_url, $images_dir . $image_name)) { $template->json_error($lang['not_download']); } // resize image include('./includes/image.php'); $resize_image = new image($images_dir . $image_name); $resize_image->resize($settings['image_width'], $settings['image_height']); mysql_query("INSERT INTO ". $tbl_prefix ."files (file, icon, filelocation, iconlocation, title, description, keywords, width, height, category, status, filetype, dateadded, added_by, adult, scores, score_type, score_name, customcode) VALUES ('". mysql_real_escape_string($file_name) ."', '". mysql_real_escape_string($image_name) ."', '". $file_location ."', '1', '". $_POST['title'] ."', '". $_POST['description'] ."', '". $_POST['keywords'] ."', ". (int) $_POST['width'] .", ". (int) $_POST['height'] .", ". (int) $_POST['category'] .", ". (int) $_POST['status'] .", '". $_POST['file_type'] ."', ". TIME_NOW .", ". $session->user_id .", '". (int) $_POST['adult'] ."', '". (int) $_POST['scores'] ."', '". (int) $_POST['score_type'] ."', '". $_POST['score_name'] ."', '')"); if ($_POST['status'] == 1) { update_stats('total_files', 1); } clear_cache(array('main_0', 'main_1', 'menu_lists')); $template->json(array('error' => false, 'message' => $lang['added'])); } break; وفي نفس الملف نغير : رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=230&'. $url)) { الى رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=241&'. $url)) { وفي نفس الملف نغير : رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=230&'. $url)) { الى رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=241&'. $url)) { وفي نفس الملف نغير : رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=230&'. $url)) { الى رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=241&'. $url)) { وفي نفس الملف نغير : رمز Code: if (!copy_file('http://www.onarcade.com/remote.php?v=230&'. $url, $file) || !copy_file('http://www.onarcade.com/files/image/'. $last['image'], $image)) { الى رمز Code: if (!copy_file('http://www.onarcade.com/remote.php?v=241&'. $url, $file) || !copy_file('http://www.onarcade.com/files/image/'. $last['image'], $image)) { وفي نفس الملف نغير : رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=230&'. $url)) { الى رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=241&'. $url)) { وفي نفس الملف نغير : رمز Code: 'description' => preg_replace('#[^a-zA-Z0-9 -_\'".,;:!?]#', '', $config['gwords']), الى رمز Code: 'description' => preg_replace('#(|)#i', '', $config['gwords']), - والآن في ملف admin/index.php .. نغير : رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=230&a=version&'. $url)) { $txt['notices'][] = array('http://www.onarcade.com/support.php', $lang['on_connection_failed']); $current_version = $onarcade_version; } else { $content = json_array($content); $current_version = $content[0]; } // get news if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=230&a=news&'. $url)) { الى رمز Code: if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=241&a=version&'. $url)) { $txt['notices'][] = array('http://www.onarcade.com/support.php', $lang['on_connection_failed']); $current_version = $onarcade_version; } else { $content = json_array($content); $current_version = $content[0]; } // get news if (!$content = get_remote_contents('http://www.onarcade.com/remote.php?v=241&a=news&'. $url)) { - والان في ملف includes/admin_functions.php .. نبحث عن : رمز Code: return (file_put_contents($to, $content)) ? true : false; ونضيف بعدهآ : رمز Code: } elseif ($settings['copy'] == 4) { if (!$content = fsock_get_contents($from)) { return false; } return (file_put_contents($to, $content)) ? true : false; وايضاً في نفس الملف نبحث عن : رمز Code: function get_real_category($category_id) { global $settings; return $settings['category_'. $category_id]; } ونضيف بعدهآ : رمز Code: // format game feed file names function get_game_feed_file_name($game_id, $file_extension) { return 'on'. $game_id .'.'. $file_extension; } - والان في ملف includes/functions.php .. نغير : رمز Code: // file file url function file_file_url($file, $location) { global $settings; return ($location == 1) ? $settings['siteurl'] .'/files/'. $settings['filesdir'] .'/'. $file : $file; } // file image URL function file_image_url($image_name, $image_location) { global $settings; return ($image_location == 1) ? $settings['siteurl'] .'/files/image/'. $image_name : $image_name; } الى رمز Code: // file file url function file_file_url($file, $location) { global $settings; return ($location == 1) ? $settings['siteurl'] .'/files/'. $settings['filesdir'] .'/'. rawurlencode($file) : $file; } // file image URL function file_image_url($image_name, $image_location) { global $settings; return ($image_location == 1) ? $settings['siteurl'] .'/files/image/'. rawurlencode($image_name) : $image_name; } وايضا في نفس الملف نغير : رمز Code: function get_file_extension($file_name) { preg_match('#\.([^\\.]+?)$#', $file_name, $match); return strtolower($match[1]); } الى رمز Code: function get_file_extension($file_name) { if (!preg_match('#\.([^\\.]+?)$#', $file_name, $match)) { return ''; } return strtolower($match[1]); } - والان في ملف jscripts/global.js .. نغير : رمز Code: full_screen.iframes = $("iframe:visible").hide(); الى رمز Code: full_screen.iframes = $("iframe:visible").not("#file_player_frame").hide (); - والان في ملف jscripts/profile.js .. نغير : رمز Code: friends_page: 0, الى رمز Code: friends_page: 1, - والان نفتح ملف القالب الاصلي للسكربت بالمسار التالي templates/onarcade/file.php ونقوم باضافة هذا الكود في اخر الملف ( الاغلب الكود بيكون موجود ، اذا كان موجود لا تقم باضافته ، اما اذا لم يكن موجود قم باضافته ) : رمز Code: {template iframe} {show overall_header} {if $txt['ad'] !== null} {$txt['ad']} {$lang['click_wait']} {/if} {$file['play_file']} {/template} - والان نفتح ملف templates/onarcade/usercp.php .. ونبحث عن : رمز Code: friends.friends = {$txt['friends']}; ونقوم باضافة هذا الكود بعدها ( ايضاً الاغلب الكود بيكون موجود ، فقط اذا لم يكن موجود قم باضافته ) : رمز Code: friends.friends_pages = {$txt['pages']}; وبسسس ~ الف مبروك الترقية . :shiny01: في النهاية هذا الشرح هو منقول من مصمم السكربت نفسه وليس من اختراعي هههه .. وانا قمت فقط بعمل الشرح بالعربي وتجربته وتمت الترقية بنجاح 100% . :icon31: اتمنى اكون قد افدتكم .. وملفات الترقية الجاهزة بالمرفقات , مع أطيب تحيآتيْ للجميعَ . :) :icon30: [IMG][/IMG] الملفات المرفقة ![]() أكثر... |
مواقع النشر (المفضلة) |
|
|
![]() |
||||
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
[طلب تصميم] : عمل ترقية لقالب اونكارد للالعاب لاخر اصدار 2.4 | RSS | Arabic Rss | 0 | 09-27-2013 03:17 AM |
[طلب] : سكربت يوتيوب onarcade اخر اصدار ‘ | RSS | Arabic Rss | 0 | 08-27-2011 11:56 PM |
[استفسار] : أريد شرح ترقية سكربت onarcade لأحدث نسخة 2.3.1 | RSS | Arabic Rss | 0 | 06-17-2011 11:42 AM |
[ مشكله ] : بعد الترقية لاخر اصدار 4.1.4 | RSS | Arabic Rss | 0 | 06-12-2011 02:00 AM |
[استفسار] : طريقة تركيب استايل لسكربت الالعاب OnArcade | RSS | Arabic Rss | 0 | 05-21-2011 10:22 PM |
|