Announcement

Collapse
No announcement yet.

BB Code styles from Fireboard to Vbulletin differences causing code to show in post

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Joe D.
    replied
    You're welcome. Good Luck.

    Leave a comment:


  • clayton47
    replied
    That's it! We're complete! I feel I can do a successful import from a very large forum. I'm excited to bring some new life to this website I'm working on. Super stoked on it! Thanks for your help over the past few days, I really appreciate it.

    Leave a comment:


  • Joe D.
    replied
    Woot!

    Make sure the usergroup has permission to use images in their signatures in vbulletin. Admin CP -> Usergroups -> Usergroup Manager -> Registered Users -> Edit...

    Go down to Signature Permissions

    Make sure use IMG BB Code is set to YES.

    Leave a comment:


  • clayton47
    replied
    Ok, I will do that now! Lets see how this goes

    - - - Updated - - -

    BOOM! Success! Awesome, glad to get this working. Referencing one last thing I mentioned above, I cant get signatures with "img" applied to a url to work... They are just showing a link without showing any bbcode. Is that something that cant be imported from Fireboard to Vbulletin?

    Thanks for the help, Im super stoked on this. I am looking forward to setting up my vbulletin 5!

    Leave a comment:


  • Joe D.
    replied
    OK try taking the U out of the line...

    PHP Code:
    $text preg_replace('# size=\d+#si'''$text); 
    Looking it over you DO want the regex to be "greedy" (that is to match as much as it can).

    Leave a comment:


  • clayton47
    replied
    OK, thank you for clearing up my wrong doing! I was doing the simple find and replace.... I havent ever used regex before. So this is kinda new to me. I am somewhat familiar with escaping characters and the importance of quotes.

    I ran the exact thing you said to run and it left me with this instead of removing it completely -
    HTML Code:
    [img50]http://
    since it left "50" for some reason it is still broke and not displaying. The regex cheat sheet I referred to is http://regexlib.com/CheatSheet.aspx

    Im trying to read that sheet and come up with another fix, maybe Im thinking to hard.

    Thanks for the help this far, so close to getting this completed!

    Leave a comment:


  • Joe D.
    replied
    When using regex's you don't use the replace array on top.

    In the file scroll down to the line that starts with #Posts

    Make it look like this:

    PHP Code:
    # Posts
    if($do_posts)
    {
        
    $posts $Db_target->query("SELECT postid, pagetext, title FROM " $targettableprefix "post");
        
        while (
    $post $Db_target->fetch_array($posts))
        {
            
    //$text = str_replace(array_keys($replacer), $replacer, $post['pagetext']);
            //$title_text = str_replace(array_keys($replacer), $replacer, $post['title']);
            
    $text preg_replace('##siU'''$text);
            
    $title_text preg_replace('##siU'''$text);
            
    $Db_target->query("UPDATE " $targettableprefix "post SET pagetext='" addslashes($text) . "', title='" addslashes($title_text) . "' WHERE postid='" $post['postid'] . "'");
            echo 
    "<br /><b>Post done -></b><i> " $post['postid'] . "</i>";
        }

    The above code has commented out the str_replace function (to replace strings) and uncommented preg_replace (the regex replace function)

    The line you are going to edit from here on it is simply:

    PHP Code:
            $text preg_replace('##siU'''$text); 
    Your Regex goes BETWEEN the two # signs... That is just the way Regex works, they need to be surrounded on both sides by a character not used in the expression. If you ever did need to use # in the expression you could switch them to ~

    PHP Code:
            $text preg_replace('~~siU'''$text); 
    The siU just tell the regular expression search how to work... i for example means match letters of upper or lower case, U means ungreedy which is a way it matches code... I forget what s does offhand... You don't need worry about it... Just put the regex I told you inside those #

    PHP Code:
            $text preg_replace('# size=\d+#siU'''$text); 
    You see the space is easy to see since everything is between # signs.

    OK save the file and run it now.

    That should get rid of all your size=xxx code... Not the '' after the regex is empty in this case because you aren't replacing code with anything. In a more typical situation where you are finding "FIND" and replacing it with "REPLACE" the line would look like:

    PHP Code:
            $text preg_replace('#FIND#siU''REPLACE'$text); 
    Final note- in the regex matching you use SINGLE QUOTES (') around strings, not DOUBLE QUOTES ("), in most string functions you can use either or but for our purposes it's important to use the singe quote.

    Leave a comment:


  • clayton47
    replied
    edit again---

    I cant get the
    HTML Code:
    \d+
    after anything to work. I am working on the fireboard img code and when I get to that part of width, size, height etc.... Anything with a specified value after the "=" it does not work in the regex.... I did exactly what Joe D said even with leaving a space before it. and leaving two empty quotes together and nothing.

    I also noticed its not working for signatures either. And the code was just a standard img with no size attribute. I do have signatures set to true in the cleaner file.

    I looked into fireboard, they didnt support video so I actually dont have to worry about that!

    This is chapping my cheeks!
    Last edited by clayton47; Thu 20th Dec '12, 9:38am.

    Leave a comment:


  • Trevor Hannant
    replied
    First thing there is that it's currently not in BBCode format, it's an HTML link so you'd need to replace all your iframe code with the [video] bbcode

    Leave a comment:


  • clayton47
    replied
    here is the code of the cleaner php file that is set to active, I used a pastebin link to keep better readability -
    http://pastebin.com/aRJ3fSUd

    I have the iframe cleaned up but it just shows the code. How do I convert it to the Vbulletin YouTube BBCode?
    Last edited by clayton47; Wed 19th Dec '12, 10:45am.

    Leave a comment:


  • Joe D.
    replied
    Can you show the full line of code you used? Did you uncomment the regex lines? I believe they are commented out by default.

    Leave a comment:


  • clayton47
    replied
    I did the above post example code by Joe D, It didnt work for me. I put in the
    HTML Code:
     size=\d+
    with a space and left empty quotes and ran the cleaner, cleared cache and nothing....


    edit----- it did for what Trevor said, But Joe D's code didnt change. I had to rebuild post cache for it to show the results.

    Still trying to figure out whats going on with the first one though.... HELP haha!
    Last edited by clayton47; Wed 19th Dec '12, 10:24am.

    Leave a comment:


  • Trevor Hannant
    replied
    If you're using cleaner.php, start with replacing the entities (and any other added characters) with the correct character, e.g.:&lt; with <
    \&quot; with "
    etc

    Leave a comment:


  • clayton47
    replied
    What kind of regex code would I put in so Iframe's would use the Vbulletin YouTube Video BBCode? I am starting to work on this. This is the last part of corrections for my import to Vbulletin. Then I will be purchasing the Vbulletin 5 Connect. I shouldnt have any issues with using the latest Vbulletin should I?

    Leave a comment:


  • Joe D.
    replied
    Passwords never get imported- Users will need to reset them via the "Reset Password" link. If you email all your users give them the link in the email.

    the iframe from youtube is being converted into HTML code for the symbols, for example < is $lt; (the lt stands for less than...) that is to prevent HTML from showing in a post which is actually a security risk...

    Assuming you'd want HTML off in vBulletin as well so this is another case you could use a regex to turn the old HTML Iframe code into vBulletin YouTube Video BBCode.

    Leave a comment:

Related Topics

Collapse

  • DemOnstar
    Put HTML here
    by DemOnstar
    Hello there. I am about to embark on another aspect of this massive learning curve and I need your help. I have given up on permissions for the time being because I am not getting very far there.
    ...
    Tue 18th Dec '12, 7:40pm
Working...
X