إنضمامك إلي منتديات استراحات زايد يحقق لك معرفة كل ماهو جديد في عالم الانترنت ...

انضم الينا
استراحات زايد الصفحة الرئيسية

         :: تفسير حلم اني انخطبت وانا عزباء (آخر رد :نوران نور)       :: القدم في المنام للعزباء (آخر رد :نوران نور)       :: تفسير حلم سقوط سن واحد سفلي في اليد (آخر رد :نوران نور)       :: تفسيرحلم الزواج للمتزوجة (آخر رد :نوران نور)       :: تفسير حلم دورة المياه للعزباء (آخر رد :نوران نور)       :: السياحة في مصر للعوائل (آخر رد :emad100)       :: رؤية طائرة في السماء في المنام (آخر رد :نوران نور)       :: رحلة انقاص وزنك تبدأ مع الرشاقة السعيدة (آخر رد :دارين الدوسري)       :: شركة سنت الفندقية (آخر رد :ريم جاسم)       :: الحمل في المنام للمطلقة (آخر رد :نوران نور)      

إضافة رد
 
LinkBack أدوات الموضوع انواع عرض الموضوع
  #1  
قديم 05-30-2009, 12:20 AM
عضو ماسي
بيانات محروم.كوم
 رقم العضوية : 503
 تاريخ التسجيل : Dec 2007
الجنس : female
علم الدوله :
 المشاركات : 2,100,611
عدد الـنقاط :3341
 تقييم المستوى : 2139

I wanted to share this with the community. I wrote this function to fix quotes in imported posts so they wouldn't show the unparsable SMF style quote code and the view post button next to the author's name would work. It uses the importpostid column to lookup the new postid. There are no guarantees on this, so make sure to test it out before doing the real import.

In the # Posts section of cleaner.php find
Code:
$text = str_replace(array_keys($replacer), $replacer, $post['pagetext']);
Add after
Code:
$text = parse_quote($text);
In the # PM text section of cleaner.php find
Code:
$text = str_replace(array_keys($replacer), $replacer, $pm['message']);
Add after
Code:
$text = parse_quote($text);
Place this at the bottom of cleaner.php
Code:
function parse_quote($post)
{
global $Db_target, $targettableprefix;

// no quote tag found, next post
if(($start = strpos($post, '[quote author=')) === false)
return $post;

// no end of tag found, next post
if(($end = strpos($post, ']', $start)) === false)
return $post;

// grab section to replace
$found = substr($post, $start, $end - $start + 1);
echo '

found: ' . $found . "
\n";

$parts = explode(' ', $found);
for($i=0; $iquery("
SELECT postid
FROM " . $targettableprefix . "post
WHERE importpostid = " . $tmppost);

if($row = $Db_target->fetch_array($request))
{
$filter['post'] = $row['postid'];
echo 'converted: post: ' . $filter['post'] . "
\n";
}
}
}
}

if(isset($filter['author']) && isset($filter['post']))
{
$replace = '[quote=' . $filter['author'] . ';' . $filter['post'] . ']';
echo 'replacing: post: ' . $replace . "\n";
$post = str_replace($found, $replace, $post);
}
else if(isset($filter['author']))
{
$replace = '[quote=' . $filter['author'] . ']';
echo 'replacing: author: ' . $replace . "\n";
$post = str_replace($found, $replace, $post);
}
else
{
echo "replacing: generic\n";
$post = str_replace($found, '[quote]', $post);
}

return parse_quote($post);
}
If interested I also used the following for the replacer varaibles

Code:
// Set true or false as to the data you want to clean

$do_posts = true;
$do_sigs = true;
$do_thread_titles = false;
$do_pm_text = true;
$do_pm_text_title = false;
Code:
$replacer = array(
"[li]" => "[*]",
"[/li]" => "",
""" => "\"",
"&" => "&",
__DEFINE_LIKE_SHARE__
رد مع اقتباس
إضافة رد

مواقع النشر (المفضلة)


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

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة
Trackbacks are متاحة
Pingbacks are متاحة
Refbacks are متاحة


المواضيع المتشابهه
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
How to add quick bb code Q - Quote? محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 04-06-2010 12:10 AM
Forum CODE to QUOTE محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 03-16-2010 04:20 AM
IPB 2.3.6 to vB 3.8.4 Cleaner code help needed محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 01-06-2010 08:20 PM
[QUOTE]* [CODE]* [HTML]* [PHP] test. محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 10-27-2009 07:30 PM
[QUOTE]* [CODE]* [HTML]* [PHP] test. محروم.كوم منتدى أخبار المواقع والمنتديات العربية والأجنبية 0 10-27-2009 07:20 PM


الساعة الآن 08:09 AM


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2 TranZ By Almuhajir

RSS RSS 2.0 XML MAP HTML