صفحة 2 من 2 الأولىالأولى 12
النتائج 16 إلى 26 من 26

الموضوع: ال ajax لا يعمل على المنتدى هل من حل ؟؟

  1. #16
    مُجَاهِد سابقاً
    تاريخ التسجيل
    Apr 2004
    المشاركات
    12,000


    اقتباس المشاركة الأصلية كتبت بواسطة JeddaHost
    تفضل طريقة دعم العربيـة للأجاكس :
    أول شي تعدل على ملف my.cnf الخاص بالقواعد
    كود:
    nano -w /etc/my.cnf
    تضيف في آخر الملف :
    كود:
    [To support Arabic language]
    default-character-set = cp1256
    character_set_client=cp1251
    default-collation=cp1256_general_ci
    init-connect=SET NAMES binary
    وآخر شي رستارت للقواعد
    service mysql restart

    مع تحياتي
    هل هذه الطريقة مجربة أخي الكريم ؟؟
    وهل يمكنك ان تعطيني مثال لمنتدى موجود على سيرفر تم تطبيق الطريقة عليه ..
    واكون شاكر لك ..





    __________________
    استخدم خاصية تنبيه المشرفين للضرورة وعند ملاحظة موضوع يخالف قوانين منتديات سوالف وسيتم مراجعة الموضوع او المشاركة المبلغ عنها على الفور

  2. #17
    عضو نشيط جدا
    تاريخ التسجيل
    May 2006
    المشاركات
    485


    السـلام عليكم

    إيـوه أخي الكريم

    مجربها لي أكثر من سنة أو 9 شهور

    أكثـر العمـلاء عندي مركبين الصندوقـ السحريـ

    يعني ما يستخدموا الأجاكـس






  3. #18
    مُجَاهِد سابقاً
    تاريخ التسجيل
    Apr 2004
    المشاركات
    12,000


    اقتباس المشاركة الأصلية كتبت بواسطة JeddaHost
    السـلام عليكم

    إيـوه أخي الكريم

    مجربها لي أكثر من سنة أو 9 شهور

    أكثـر العمـلاء عندي مركبين الصندوقـ السحريـ

    يعني ما يستخدموا الأجاكـس
    جربتها .. وسويت اعادة تشغيل لـ
    SQL Server (MySQL)
    و
    HTTP Server (Apache)


    ونفس المشكلة ..!!!





    __________________
    استخدم خاصية تنبيه المشرفين للضرورة وعند ملاحظة موضوع يخالف قوانين منتديات سوالف وسيتم مراجعة الموضوع او المشاركة المبلغ عنها على الفور

  4. #19
    مُجَاهِد سابقاً
    تاريخ التسجيل
    Apr 2004
    المشاركات
    12,000


    من لديه الحل لا يبخل علينا ..





    __________________
    استخدم خاصية تنبيه المشرفين للضرورة وعند ملاحظة موضوع يخالف قوانين منتديات سوالف وسيتم مراجعة الموضوع او المشاركة المبلغ عنها على الفور

  5. #20


    في حل بس ما ادري اذا يسبب مشاكل امنية ولا لا
    تدخل ملف الـ modsec.conf في السيرفر
    pico /usr/local/apache/conf/modsec.conf
    وتغير SecFilterScanPOST On الى SecFilterScanPOST Off
    وبعدين تعمل ريستارت للاباتشي
    httpd restart
    وبيشتغل معاك كويس
    جرب وردلي
    تحيايتي






  6. #21

    تاريخ التسجيل
    May 2001
    المشاركات
    3,294


    السلام عليكم ..

    اخوي جرب هذا الكود ضعه في ملف و قم بتسميته على سبيل المثال ajax.php
    و ضعه في فولدر المنتدى الرئيسي ..

    كود:
    <?php
     
     
    // ####################### SET PHP ENVIRONMENT ###########################
    error_reporting(E_ALL & ~E_NOTICE);
    
    // #################### DEFINE IMPORTANT CONSTANTS #######################
    define('THIS_SCRIPT', 'ajax');
    define('LOCATION_BYPASS', 1);
    define('NOPMPOPUP', 1);
    
    // ################### PRE-CACHE TEMPLATES AND DATA ######################
    // get special phrase groups
    $phrasegroups = array('posting');
    
    // get special data templates from the datastore
    $specialtemplates = array('bbcodecache');
    
    // pre-cache templates used by all actions
    $globaltemplates = array();
    
    // pre-cache templates used by specific actions
    $actiontemplates = array();
    
    // ######################### REQUIRE BACK-END ############################
    require_once('./global.php');
    
    // #######################################################################
    // ######################## START MAIN SCRIPT ############################
    // #######################################################################
    
    // browsers tend to interpret iso-8859-1 as windows-1252, but Microsoft.XMLHttp doesn't
    // so we need to tell it too :-/
    if (strtolower($vbulletin->userinfo['lang_charset']) == 'iso-8859-1')
    {
    	$ajax_charset = 'windows-1252';
    }
    else
    {
    	$ajax_charset = $vbulletin->userinfo['lang_charset'];
    }
    
    ($hook = vBulletinHook::fetch_hook('ajax_start')) ? eval($hook) : false;
    
    // #############################################################################
    // user name search
    
    if ($_POST['do'] == 'usersearch')
    {
    	$vbulletin->input->clean_array_gpc('p', array('fragment' => TYPE_STR));
    
    	$vbulletin->GPC['fragment'] = convert_urlencoded_unicode($vbulletin->GPC['fragment']);
    
    	if ($vbulletin->GPC['fragment'] != '' AND strlen($vbulletin->GPC['fragment']) >= 3)
    	{
    		$fragment = htmlspecialchars_uni($vbulletin->GPC['fragment']);
    	}
    	else
    	{
    		$fragment = '';
    	}
    
    	header('Content-Type: text/xml' . iif($ajax_charset != '', '; charset=' . $ajax_charset));
    	echo '<?xml version="1.0" encoding="' . $ajax_charset . '"?>' . "\r\n<users>\r\n";
    
    	if ($fragment != '')
    	{
    		$users = $db->query_read("
    			SELECT userid, username FROM " . TABLE_PREFIX . "user
    			WHERE username LIKE('" . $db->escape_string_like($fragment) . "%')
    			ORDER BY username
    			LIMIT 15
    		");
    		while ($user = $db->fetch_array($users))
    		{
    			echo "\t<user userid=\"$user[userid]\">$user[username]</user>\r\n";
    		}
    	}
    
    	echo "</users>";
    }
    
    // #############################################################################
    // update thread title
    
    if ($_POST['do'] == 'updatethreadtitle')
    {
    	$vbulletin->input->clean_array_gpc('p', array('threadid' => TYPE_UINT, 'title' => TYPE_STR));
    
    	@header('Content-Type: text/html' . iif($ajax_charset != '', '; charset=' . $ajax_charset));
    
    	// allow edit if...
    	if (
    		can_moderate($threadinfo['forumid'], 'caneditthreads') // ...user is moderator
    		OR
    		(
    			$threadinfo['postuserid'] == $vbulletin->userinfo['userid'] // ...user is thread first poster
    			AND
    			($forumperms = fetch_permissions($threadinfo['forumid'])) AND ($forumperms & $vbulletin->bf_ugp_forumpermissions['caneditpost']) // ...user has edit own posts permissions
    			AND
    			($threadinfo['dateline'] + $vbulletin->options['editthreadtitlelimit'] * 60) > TIMENOW // ...thread was posted within editthreadtimelimit
    		)
    	)
    	{
    		$threaddata =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
    		$threaddata->set_existing($threadinfo);
    		$threaddata->set('title', convert_urlencoded_unicode($vbulletin->GPC['title']));
    
    		$getfirstpost = $db->query_first("
    			SELECT *
    			FROM " . TABLE_PREFIX . "post
    			WHERE threadid = $threadinfo[threadid]
    			ORDER BY dateline
    			LIMIT 1
    		");
    
    		if ($threaddata->save())
    		{
    			// Reindex first post to set up title properly.
    			require_once(DIR . '/includes/functions_databuild.php');
    			delete_post_index($getfirstpost['postid'], $getfirstpost['title'], $getfirstpost['pagetext']);
    			$getfirstpost['threadtitle'] = $threaddata->fetch_field('title');
    			$getfirstpost['title'] =& $getfirstpost['threadtitle'];
    			build_post_index($getfirstpost['postid'] , $foruminfo, 1, $getfirstpost);
    
    			require_once(DIR . '/includes/functions_forumlist.php');
    			cache_ordered_forums(1);
    
    			if ($vbulletin->forumcache["$threadinfo[forumid]"]['lastthreadid'] == $threadinfo['threadid'])
    			{
    				require_once(DIR . '/includes/functions_databuild.php');
    				build_forum_counters($threadinfo['forumid']);
    			}
    
    			// we do not appear to log thread title updates
    			echo $threaddata->thread['title'];
    			exit;
    		}
    	}
    
    	echo $threadinfo['title'];
    }
    
    // #############################################################################
    // toggle thread open/close
    
    if ($_POST['do'] == 'updatethreadopen')
    {
    	$vbulletin->input->clean_array_gpc('p', array('threadid' => TYPE_UINT, 'src' => TYPE_NOHTML));
    
    	if ($threadinfo['open'] == 10)
    	{	// thread redirect
    		exit;
    	}
    
    	// allow edit if...
    	if (
    		can_moderate($threadinfo['forumid'], 'canopenclose') // user is moderator
    		OR
    		(
    			$threadinfo['postuserid'] == $vbulletin->userinfo['userid'] // user is thread first poster
    			AND
    			($forumperms = fetch_permissions($threadinfo['forumid'])) AND ($forumperms & $vbulletin->bf_ugp_forumpermissions['canopenclose']) // user has permission to open / close own threads
    		)
    	)
    	{
    		if (strpos($vbulletin->GPC['src'], '_lock') !== false)
    		{
    			$open = 1;
    		}
    		else
    		{
    			$open = 0;
    		}
    
    		$threaddata =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
    		$threaddata->set_existing($threadinfo);
    		$threaddata->set('open', $open); // note: mod logging will occur automatically
    		if ($threaddata->save())
    		{
    			if ($open)
    			{
    				$vbulletin->GPC['src'] = str_replace('_lock', '', $vbulletin->GPC['src']);
    			}
    			else
    			{
    				$vbulletin->GPC['src'] = preg_replace('/(\_dot)?(\_hot)?(\_new)?(\.(gif|png|jpg))/', '\1\2_lock\3\4', $vbulletin->GPC['src']);
    			}
    		}
    	}
    
    	@header('Content-Type: text/plain' . iif($ajax_charset != '', '; charset=' . $ajax_charset));
    	echo $vbulletin->GPC['src'];
    }
    
    // #############################################################################
    // return a post in an editor
    
    if ($_POST['do'] == 'quickedit')
    {
    	$vbulletin->input->clean_array_gpc('p', array(
    		'postid' => TYPE_UINT,
    		'editorid' => TYPE_STR
    	));
    
    	if (!$vbulletin->options['quickedit'])
    	{
    		// if quick edit has been disabled after showthread is loaded, return a string to indicate such
    		echo 'disabled';
    		exit;
    	}
    
    	$vbulletin->GPC['editorid'] = preg_replace('/\W/s', '', $vbulletin->GPC['editorid']);
    
    	if (!$postinfo['postid'])
    	{
    		exit;
    	}
    
    	if ((!$postinfo['visible'] OR $postinfo ['isdeleted']) AND !can_moderate($threadinfo['forumid']))
    	{
    		exit;
    	}
    
    	if ((!$threadinfo['visible'] OR $threadinfo['isdeleted']) AND !can_moderate($threadinfo['forumid']))
    	{
    		exit;
    	}
    
    	$forumperms = fetch_permissions($threadinfo['forumid']);
    	if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
    	{
    		exit;
    	}
    	if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($threadinfo['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0))
    	{
    		exit;
    	}
    
    	// check if there is a forum password and if so, ensure the user has it set
    	verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
    
    	// Tachy goes to coventry
    	if (in_coventry($threadinfo['postuserid']) AND !can_moderate($threadinfo['forumid']))
    	{
    		// do not show post if part of a thread from a user in Coventry and bbuser is not mod
    		exit;
    	}
    	if (in_coventry($postinfo['userid']) AND !can_moderate($threadinfo['forumid']))
    	{
    		// do not show post if posted by a user in Coventry and bbuser is not mod
    		exit;
    	}
    
    	$show['managepost'] = iif(can_moderate($threadinfo['forumid'], 'candeleteposts') OR can_moderate($threadinfo['forumid'], 'canremoveposts'), true, false);
    	$show['approvepost'] = (can_moderate($threadinfo['forumid'], 'canmoderateposts')) ? true : false;
    	$show['managethread'] = (can_moderate($threadinfo['forumid'], 'canmanagethreads')) ? true : false;
    	$show['quick_edit_form_tag'] = ($show['managethread'] OR $show['managepost'] OR $show['approvepost']) ? false : true;
    
    	// Is this the first post in the thread?
    	$isfirstpost = $postinfo['postid'] == $threadinfo['firstpostid'] ? true : false;
    
    	if ($isfirstpost AND can_moderate($threadinfo['forumid'], 'canmanagethreads'))
    	{
    		$show['deletepostoption'] = true;
    	}
    	else if (!$isfirstpost AND can_moderate($threadinfo['forumid'], 'candeleteposts'))
    	{
    		$show['deletepostoption'] = true;
    	}
    	else if (((($forumperms & $vbulletin->bf_ugp_forumpermissions['candeletepost']) AND !$isfirstpost) OR (($forumperms & $vbulletin->bf_ugp_forumpermissions['candeletethread']) AND $isfirstpost)) AND $vbulletin->userinfo['userid'] == $postinfo['userid'])
    	{
    		$show['deletepostoption'] = true;
    	}
    	else
    	{
    		$show['deletepostoption'] = false;
    	}
    
    	$show['physicaldeleteoption'] = iif (can_moderate($threadinfo['forumid'], 'canremoveposts'), true, false);
    	$show['keepattachmentsoption'] = iif ($postinfo['attach'], true, false);
    	$show['firstpostnote'] = $isfirstpost;
    
    	//header('Content-Type: text/html' . iif($ajax_charset != '', ';charset=' . strtolower($ajax_charset)));
    	//echo "<textarea rows=\"10\" cols=\"60\" title=\"" . $vbulletin->GPC['editorid'] . "\">" . $postinfo['pagetext'] . '</textarea>';
    
    	require_once(DIR . '/includes/functions_editor.php');
    
    	$forum_allowsmilies = ($foruminfo['allowsmilies'] ? 1 : 0);
    	$editor_parsesmilies = ($forum_allowsmilies AND $postinfo['allowsmilie'] ? 1 : 0);
    
    	construct_edit_toolbar(htmlspecialchars_uni($postinfo['pagetext']), 0, $foruminfo['forumid'], $forum_allowsmilies, $postinfo['allowsmilie'], false, 'qe', $vbulletin->GPC['editorid']);
    
    	header('Content-Type: text/xml' . iif($ajax_charset != '', ';charset=' . strtolower($ajax_charset)));
    	echo '<?xml version="1.0" encoding="' . $ajax_charset . '"?>' .
    		"\r\n<editor parsetype=\"$foruminfo[forumid]\" parsesmilies=\"$editor_parsesmilies\" mode=\"$show[is_wysiwyg_editor]\"><![CDATA[" .
    		$messagearea .
    		"]]></editor>";
    }
    
    // #############################################################################
    // handle editor mode switching
    
    if ($_POST['do'] == 'editorswitch')
    {
    	$vbulletin->input->clean_array_gpc('p', array(
    		'towysiwyg' => TYPE_BOOL,
    		'message' => TYPE_STR,
    		'parsetype' => TYPE_STR, // string to support non-forum options
    		'allowsmilie' => TYPE_BOOL
    	));
    
    	$vbulletin->GPC['message'] = convert_urlencoded_unicode($vbulletin->GPC['message']);
    
    	require_once(DIR . '/includes/functions_wysiwyg.php');
    
    	if ($vbulletin->GPC['towysiwyg'])
    	{
    		// from standard to wysiwyg
    		echo parse_wysiwyg_html($vbulletin->GPC['message'], false, $vbulletin->GPC['parsetype'], $vbulletin->GPC['allowsmilie']);
    	}
    	else
    	{
    		// from wysiwyg to standard
    		switch ($vbulletin->GPC['parsetype'])
    		{
    			case 'calendar':
    				$calendarinfo = verify_id('calendar', $vbulletin->GPC['parsetype'], 0, 1);
    				$dohtml = $calendarinfo['allowhtml']; break;
    
    			case 'privatemessage':
    				$dohtml = $vbulletin->options['privallowhtml']; break;
    
    			case 'usernote':
    				$dohtml = $vbulletin->options['unallowhtml']; break;
    
    			case 'nonforum':
    				$dohtml = $vbulletin->options['allowhtml']; break;
    
    			default:
    				$parsetype = intval($vbulletin->GPC['parsetype']);
    				$foruminfo = fetch_foruminfo($parsetype);
    				$dohtml = $foruminfo['allowhtml']; break;
    		}
    
    		echo convert_wysiwyg_html_to_bbcode($vbulletin->GPC['message'], $dohtml);
    	}
    }
    
    ($hook = vBulletinHook::fetch_hook('ajax_complete')) ? eval($hook) : false;
    
     /*======================================================================*\r
    || ####################################################################
    || # CVS: $RCSfile: ajax.php,v $ - $Revision: 1.25.2.1 $/*======================================================================*\r
    || ####################################################################
    \*======================================================================*/
    ?>
    وان شاءالله راح يضبط

    تحياتي





    __________________
    استخدم خاصية تنبيه المشرفين للضرورة وعند ملاحظة موضوع يخالف قوانين منتديات سوالف وسيتم مراجعة الموضوع او المشاركة المبلغ عنها على الفور

  7. #22
    مُجَاهِد سابقاً
    تاريخ التسجيل
    Apr 2004
    المشاركات
    12,000


    اقتباس المشاركة الأصلية كتبت بواسطة فاقد الامل
    في حل بس ما ادري اذا يسبب مشاكل امنية ولا لا
    تدخل ملف الـ modsec.conf في السيرفر

    وتغير SecFilterScanPOST On الى SecFilterScanPOST Off
    وبعدين تعمل ريستارت للاباتشي
    httpd restart
    وبيشتغل معاك كويس
    جرب وردلي
    تحيايتي
    الاجاكس تعمل بنجاح ..
    ولكن المشكلة في الترميز ..
    فقط هنا المشكلة ..





    __________________
    استخدم خاصية تنبيه المشرفين للضرورة وعند ملاحظة موضوع يخالف قوانين منتديات سوالف وسيتم مراجعة الموضوع او المشاركة المبلغ عنها على الفور

  8. #23
    مُجَاهِد سابقاً
    تاريخ التسجيل
    Apr 2004
    المشاركات
    12,000


    اقتباس المشاركة الأصلية كتبت بواسطة Net Hunter
    السلام عليكم ..

    اخوي جرب هذا الكود ضعه في ملف و قم بتسميته على سبيل المثال ajax.php
    و ضعه في فولدر المنتدى الرئيسي ..

    كود:
    <?php
     
     
    // ####################### SET PHP ENVIRONMENT ###########################
    error_reporting(E_ALL & ~E_NOTICE);
    
    // #################### DEFINE IMPORTANT CONSTANTS #######################
    define('THIS_SCRIPT', 'ajax');
    define('LOCATION_BYPASS', 1);
    define('NOPMPOPUP', 1);
    
    // ################### PRE-CACHE TEMPLATES AND DATA ######################
    // get special phrase groups
    $phrasegroups = array('posting');
    
    // get special data templates from the datastore
    $specialtemplates = array('bbcodecache');
    
    // pre-cache templates used by all actions
    $globaltemplates = array();
    
    // pre-cache templates used by specific actions
    $actiontemplates = array();
    
    // ######################### REQUIRE BACK-END ############################
    require_once('./global.php');
    
    // #######################################################################
    // ######################## START MAIN SCRIPT ############################
    // #######################################################################
    
    // browsers tend to interpret iso-8859-1 as windows-1252, but Microsoft.XMLHttp doesn't
    // so we need to tell it too :-/
    if (strtolower($vbulletin->userinfo['lang_charset']) == 'iso-8859-1')
    {
    	$ajax_charset = 'windows-1252';
    }
    else
    {
    	$ajax_charset = $vbulletin->userinfo['lang_charset'];
    }
    
    ($hook = vBulletinHook::fetch_hook('ajax_start')) ? eval($hook) : false;
    
    // #############################################################################
    // user name search
    
    if ($_POST['do'] == 'usersearch')
    {
    	$vbulletin->input->clean_array_gpc('p', array('fragment' => TYPE_STR));
    
    	$vbulletin->GPC['fragment'] = convert_urlencoded_unicode($vbulletin->GPC['fragment']);
    
    	if ($vbulletin->GPC['fragment'] != '' AND strlen($vbulletin->GPC['fragment']) >= 3)
    	{
    		$fragment = htmlspecialchars_uni($vbulletin->GPC['fragment']);
    	}
    	else
    	{
    		$fragment = '';
    	}
    
    	header('Content-Type: text/xml' . iif($ajax_charset != '', '; charset=' . $ajax_charset));
    	echo '<?xml version="1.0" encoding="' . $ajax_charset . '"?>' . "\r\n<users>\r\n";
    
    	if ($fragment != '')
    	{
    		$users = $db->query_read("
    			SELECT userid, username FROM " . TABLE_PREFIX . "user
    			WHERE username LIKE('" . $db->escape_string_like($fragment) . "%')
    			ORDER BY username
    			LIMIT 15
    		");
    		while ($user = $db->fetch_array($users))
    		{
    			echo "\t<user userid=\"$user[userid]\">$user[username]</user>\r\n";
    		}
    	}
    
    	echo "</users>";
    }
    
    // #############################################################################
    // update thread title
    
    if ($_POST['do'] == 'updatethreadtitle')
    {
    	$vbulletin->input->clean_array_gpc('p', array('threadid' => TYPE_UINT, 'title' => TYPE_STR));
    
    	@header('Content-Type: text/html' . iif($ajax_charset != '', '; charset=' . $ajax_charset));
    
    	// allow edit if...
    	if (
    		can_moderate($threadinfo['forumid'], 'caneditthreads') // ...user is moderator
    		OR
    		(
    			$threadinfo['postuserid'] == $vbulletin->userinfo['userid'] // ...user is thread first poster
    			AND
    			($forumperms = fetch_permissions($threadinfo['forumid'])) AND ($forumperms & $vbulletin->bf_ugp_forumpermissions['caneditpost']) // ...user has edit own posts permissions
    			AND
    			($threadinfo['dateline'] + $vbulletin->options['editthreadtitlelimit'] * 60) > TIMENOW // ...thread was posted within editthreadtimelimit
    		)
    	)
    	{
    		$threaddata =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
    		$threaddata->set_existing($threadinfo);
    		$threaddata->set('title', convert_urlencoded_unicode($vbulletin->GPC['title']));
    
    		$getfirstpost = $db->query_first("
    			SELECT *
    			FROM " . TABLE_PREFIX . "post
    			WHERE threadid = $threadinfo[threadid]
    			ORDER BY dateline
    			LIMIT 1
    		");
    
    		if ($threaddata->save())
    		{
    			// Reindex first post to set up title properly.
    			require_once(DIR . '/includes/functions_databuild.php');
    			delete_post_index($getfirstpost['postid'], $getfirstpost['title'], $getfirstpost['pagetext']);
    			$getfirstpost['threadtitle'] = $threaddata->fetch_field('title');
    			$getfirstpost['title'] =& $getfirstpost['threadtitle'];
    			build_post_index($getfirstpost['postid'] , $foruminfo, 1, $getfirstpost);
    
    			require_once(DIR . '/includes/functions_forumlist.php');
    			cache_ordered_forums(1);
    
    			if ($vbulletin->forumcache["$threadinfo[forumid]"]['lastthreadid'] == $threadinfo['threadid'])
    			{
    				require_once(DIR . '/includes/functions_databuild.php');
    				build_forum_counters($threadinfo['forumid']);
    			}
    
    			// we do not appear to log thread title updates
    			echo $threaddata->thread['title'];
    			exit;
    		}
    	}
    
    	echo $threadinfo['title'];
    }
    
    // #############################################################################
    // toggle thread open/close
    
    if ($_POST['do'] == 'updatethreadopen')
    {
    	$vbulletin->input->clean_array_gpc('p', array('threadid' => TYPE_UINT, 'src' => TYPE_NOHTML));
    
    	if ($threadinfo['open'] == 10)
    	{	// thread redirect
    		exit;
    	}
    
    	// allow edit if...
    	if (
    		can_moderate($threadinfo['forumid'], 'canopenclose') // user is moderator
    		OR
    		(
    			$threadinfo['postuserid'] == $vbulletin->userinfo['userid'] // user is thread first poster
    			AND
    			($forumperms = fetch_permissions($threadinfo['forumid'])) AND ($forumperms & $vbulletin->bf_ugp_forumpermissions['canopenclose']) // user has permission to open / close own threads
    		)
    	)
    	{
    		if (strpos($vbulletin->GPC['src'], '_lock') !== false)
    		{
    			$open = 1;
    		}
    		else
    		{
    			$open = 0;
    		}
    
    		$threaddata =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
    		$threaddata->set_existing($threadinfo);
    		$threaddata->set('open', $open); // note: mod logging will occur automatically
    		if ($threaddata->save())
    		{
    			if ($open)
    			{
    				$vbulletin->GPC['src'] = str_replace('_lock', '', $vbulletin->GPC['src']);
    			}
    			else
    			{
    				$vbulletin->GPC['src'] = preg_replace('/(\_dot)?(\_hot)?(\_new)?(\.(gif|png|jpg))/', '\1\2_lock\3\4', $vbulletin->GPC['src']);
    			}
    		}
    	}
    
    	@header('Content-Type: text/plain' . iif($ajax_charset != '', '; charset=' . $ajax_charset));
    	echo $vbulletin->GPC['src'];
    }
    
    // #############################################################################
    // return a post in an editor
    
    if ($_POST['do'] == 'quickedit')
    {
    	$vbulletin->input->clean_array_gpc('p', array(
    		'postid' => TYPE_UINT,
    		'editorid' => TYPE_STR
    	));
    
    	if (!$vbulletin->options['quickedit'])
    	{
    		// if quick edit has been disabled after showthread is loaded, return a string to indicate such
    		echo 'disabled';
    		exit;
    	}
    
    	$vbulletin->GPC['editorid'] = preg_replace('/\W/s', '', $vbulletin->GPC['editorid']);
    
    	if (!$postinfo['postid'])
    	{
    		exit;
    	}
    
    	if ((!$postinfo['visible'] OR $postinfo ['isdeleted']) AND !can_moderate($threadinfo['forumid']))
    	{
    		exit;
    	}
    
    	if ((!$threadinfo['visible'] OR $threadinfo['isdeleted']) AND !can_moderate($threadinfo['forumid']))
    	{
    		exit;
    	}
    
    	$forumperms = fetch_permissions($threadinfo['forumid']);
    	if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
    	{
    		exit;
    	}
    	if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($threadinfo['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0))
    	{
    		exit;
    	}
    
    	// check if there is a forum password and if so, ensure the user has it set
    	verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
    
    	// Tachy goes to coventry
    	if (in_coventry($threadinfo['postuserid']) AND !can_moderate($threadinfo['forumid']))
    	{
    		// do not show post if part of a thread from a user in Coventry and bbuser is not mod
    		exit;
    	}
    	if (in_coventry($postinfo['userid']) AND !can_moderate($threadinfo['forumid']))
    	{
    		// do not show post if posted by a user in Coventry and bbuser is not mod
    		exit;
    	}
    
    	$show['managepost'] = iif(can_moderate($threadinfo['forumid'], 'candeleteposts') OR can_moderate($threadinfo['forumid'], 'canremoveposts'), true, false);
    	$show['approvepost'] = (can_moderate($threadinfo['forumid'], 'canmoderateposts')) ? true : false;
    	$show['managethread'] = (can_moderate($threadinfo['forumid'], 'canmanagethreads')) ? true : false;
    	$show['quick_edit_form_tag'] = ($show['managethread'] OR $show['managepost'] OR $show['approvepost']) ? false : true;
    
    	// Is this the first post in the thread?
    	$isfirstpost = $postinfo['postid'] == $threadinfo['firstpostid'] ? true : false;
    
    	if ($isfirstpost AND can_moderate($threadinfo['forumid'], 'canmanagethreads'))
    	{
    		$show['deletepostoption'] = true;
    	}
    	else if (!$isfirstpost AND can_moderate($threadinfo['forumid'], 'candeleteposts'))
    	{
    		$show['deletepostoption'] = true;
    	}
    	else if (((($forumperms & $vbulletin->bf_ugp_forumpermissions['candeletepost']) AND !$isfirstpost) OR (($forumperms & $vbulletin->bf_ugp_forumpermissions['candeletethread']) AND $isfirstpost)) AND $vbulletin->userinfo['userid'] == $postinfo['userid'])
    	{
    		$show['deletepostoption'] = true;
    	}
    	else
    	{
    		$show['deletepostoption'] = false;
    	}
    
    	$show['physicaldeleteoption'] = iif (can_moderate($threadinfo['forumid'], 'canremoveposts'), true, false);
    	$show['keepattachmentsoption'] = iif ($postinfo['attach'], true, false);
    	$show['firstpostnote'] = $isfirstpost;
    
    	//header('Content-Type: text/html' . iif($ajax_charset != '', ';charset=' . strtolower($ajax_charset)));
    	//echo "<textarea rows=\"10\" cols=\"60\" title=\"" . $vbulletin->GPC['editorid'] . "\">" . $postinfo['pagetext'] . '</textarea>';
    
    	require_once(DIR . '/includes/functions_editor.php');
    
    	$forum_allowsmilies = ($foruminfo['allowsmilies'] ? 1 : 0);
    	$editor_parsesmilies = ($forum_allowsmilies AND $postinfo['allowsmilie'] ? 1 : 0);
    
    	construct_edit_toolbar(htmlspecialchars_uni($postinfo['pagetext']), 0, $foruminfo['forumid'], $forum_allowsmilies, $postinfo['allowsmilie'], false, 'qe', $vbulletin->GPC['editorid']);
    
    	header('Content-Type: text/xml' . iif($ajax_charset != '', ';charset=' . strtolower($ajax_charset)));
    	echo '<?xml version="1.0" encoding="' . $ajax_charset . '"?>' .
    		"\r\n<editor parsetype=\"$foruminfo[forumid]\" parsesmilies=\"$editor_parsesmilies\" mode=\"$show[is_wysiwyg_editor]\"><![CDATA[" .
    		$messagearea .
    		"]]></editor>";
    }
    
    // #############################################################################
    // handle editor mode switching
    
    if ($_POST['do'] == 'editorswitch')
    {
    	$vbulletin->input->clean_array_gpc('p', array(
    		'towysiwyg' => TYPE_BOOL,
    		'message' => TYPE_STR,
    		'parsetype' => TYPE_STR, // string to support non-forum options
    		'allowsmilie' => TYPE_BOOL
    	));
    
    	$vbulletin->GPC['message'] = convert_urlencoded_unicode($vbulletin->GPC['message']);
    
    	require_once(DIR . '/includes/functions_wysiwyg.php');
    
    	if ($vbulletin->GPC['towysiwyg'])
    	{
    		// from standard to wysiwyg
    		echo parse_wysiwyg_html($vbulletin->GPC['message'], false, $vbulletin->GPC['parsetype'], $vbulletin->GPC['allowsmilie']);
    	}
    	else
    	{
    		// from wysiwyg to standard
    		switch ($vbulletin->GPC['parsetype'])
    		{
    			case 'calendar':
    				$calendarinfo = verify_id('calendar', $vbulletin->GPC['parsetype'], 0, 1);
    				$dohtml = $calendarinfo['allowhtml']; break;
    
    			case 'privatemessage':
    				$dohtml = $vbulletin->options['privallowhtml']; break;
    
    			case 'usernote':
    				$dohtml = $vbulletin->options['unallowhtml']; break;
    
    			case 'nonforum':
    				$dohtml = $vbulletin->options['allowhtml']; break;
    
    			default:
    				$parsetype = intval($vbulletin->GPC['parsetype']);
    				$foruminfo = fetch_foruminfo($parsetype);
    				$dohtml = $foruminfo['allowhtml']; break;
    		}
    
    		echo convert_wysiwyg_html_to_bbcode($vbulletin->GPC['message'], $dohtml);
    	}
    }
    
    ($hook = vBulletinHook::fetch_hook('ajax_complete')) ? eval($hook) : false;
    
     /*======================================================================*\r
    || ####################################################################
    || # CVS: $RCSfile: ajax.php,v $ - $Revision: 1.25.2.1 $/*======================================================================*\r
    || ####################################################################
    \*======================================================================*/
    ?>
    وان شاءالله راح يضبط

    تحياتي
    يوجد هذا الملف في مجلد المنتدى
    ajax.php
    هل يتم استبداله ؟؟
    وهل ما ذكرته يحل مشكلة الترميز ؟؟





    __________________
    استخدم خاصية تنبيه المشرفين للضرورة وعند ملاحظة موضوع يخالف قوانين منتديات سوالف وسيتم مراجعة الموضوع او المشاركة المبلغ عنها على الفور

  9. #24
    عضو سوبر نشيط
    تاريخ التسجيل
    Nov 2005
    المشاركات
    813


    لا يوجد احد الحلول نجحت الى الآن

    هل احد يستطيع ان يفدينا

    وشكرا لك من شارك في الموضوع

    ولرفع مرة اخرى






  10. #25
    مُجَاهِد سابقاً
    تاريخ التسجيل
    Apr 2004
    المشاركات
    12,000


    اقتباس المشاركة الأصلية كتبت بواسطة OKYESNO
    لا يوجد احد الحلول نجحت الى الآن

    هل احد يستطيع ان يفدينا

    وشكرا لك من شارك في الموضوع

    ولرفع مرة اخرى
    ننتظر الحل من الخبراء ..





    __________________
    استخدم خاصية تنبيه المشرفين للضرورة وعند ملاحظة موضوع يخالف قوانين منتديات سوالف وسيتم مراجعة الموضوع او المشاركة المبلغ عنها على الفور

  11. #26
    عضو نشيط
    تاريخ التسجيل
    Sep 2006
    المشاركات
    132


    رفع مرة اخرى










ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  

أضف موقعك هنا| اخبار السيارات | حراج | شقق للايجار في الكويت | بيوت للبيع في الكويت | دليل الكويت العقاري | مقروء | شركة كشف تسربات المياه | شركة عزل اسطح بالرياض | عزل فوم بالرياض| عزل اسطح بالرياض | كشف تسربات المياة بالرياض | شركة عزل اسطح بالرياض