|
إنضمامك إلي منتديات استراحات زايد يحقق لك معرفة كل ماهو جديد في عالم الانترنت ...
انضم الينا
#1
| ||
| ||
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__ |
مواقع النشر (المفضلة) |
| |
المواضيع المتشابهه | ||||
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
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 |