Announcement

Collapse
No announcement yet.

External incoming links

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    Question, will this work with the vBerror page mod? I know at one time the incoming links redirect was working but its not now.

    I have vBerror pages 1.0 installed currently.

    Comment


    • #47
      That's something you'd have to ask the modification author.
      Best Regards
      Colin Frei

      Please don't contact me per PM.

      Comment


      • #48
        Any hope for getting this redirect script for Web Wiz Forums moving to vBulletin?

        Comment


        • #49
          This script is not intended as a finished solution for all board types. It is ment as a framework to use to create the redirects needed in your specific situation.
          Want to take your board beyond the standard vBulletin features?
          Visit the official Member to Member support site for vBulletin Modifications: www.vbulletin.org

          Comment


          • #50
            Hi there,

            I created my new scripts and they are working fine now. Instead of consulting the database what I did was to create a fixed table containing the old threadid's (importthreadid) and the new ones (threadid). In order to improve performance (bigest issue I had) I created several tables.

            First you need to run the script below to create the files (tables).

            Code:
            
            <?
            $dbhost1 = 'localhost';
            $dbusername1 = 'username';
            $dbuserpassword1 = 'password';
            $vbul1 = mysql_pconnect($dbhost1, $dbusername1, $dbuserpassword1);
            if (!$vbul1) {
            die('Could not connect: ' . mysql_error());
            }
            mysql_select_db("vbulletin",$vbul1);
            $count=0;
            $step = 1000;
            $query=mysql_query("SELECT importthreadid FROM thread ORDER BY importthreadid DESC LIMIT 1");
            $row=mysql_fetch_row($query);
            $total=$row[0];
            while ($count<$total)
            {
            $query=mysql_query("SELECT importthreadid,threadid FROM thread WHERE importthreadid>$count AND importthreadid<$count+$step");
            $result="";
            while ($row=mysql_fetch_array($query))
            {
            $result .= serialize($row);
            $result .="\n";
            }
            $cachefile="/www/forum/converter/".$count.".php";
            // open the cache file for writing
            $fp = @fopen($cachefile, 'w'); 
            // save the contents of output buffer to the file
            @fwrite($fp, $result);
            // close the file
            @fclose($fp);
            $count += $step;
            }
            ?>


            Then I added the following code at the beginning of my index.php:

            Code:
            // Converter Start
            if ($_GET['showtopic'])
            {
            $showtopic=$_GET['showtopic'];
            $file=floor($showtopic/1000)*1000;
            $cachefile="/www/forum/converter/".$file.".php";
            $dados=file($cachefile);
            while (list($key,$value) = each($dados))
            {
            $row=unserialize($value);
            $importthreadid=$row['importthreadid'];
            $threadid=$row['threadid'];
            if ($importthreadid==$showtopic)
            {
            break;
            }
            }
            Header( "HTTP/1.1 301 Moved Permanently" ); 
            Header( "Location: http://forum.clubedohardware.com.br/showthread.php?t=".$threadid); 
            exit();
            }
            // Converter End


            And also created the file below and saved as index.php under /lofiversion:

            Code:
            
            <?
            $url=$_SERVER['REQUEST_URI'];
            $result=explode("/lofiversion/index.php/t",$url);
            $result=explode(".html",$result[1]);
            $showtopic=$result[0];
            if ($showtopic)
            {
            $file=floor($showtopic/1000)*1000;
            $cachefile="/www/forum/converter/".$file.".php";
            $dados=file($cachefile);
            while (list($key,$value) = each($dados))
            {
            $row=unserialize($value);
            $importthreadid=$row['importthreadid'];
            $threadid=$row['threadid'];
            if ($importthreadid==$showtopic)
            {
            break;
            }
            }
            Header( "HTTP/1.1 301 Moved Permanently" ); 
            Header( "Location: http://forum.clubedohardware.com.br/showthread.php?t=".$threadid); 
            }
            else
            {
            Header( "HTTP/1.1 301 Moved Permanently" ); 
            Header( "Location: http://forum.clubedohardware.com.br"); 
            }
            ?>


            I am not a real programmer myself, so this code may need a fine tuning, especially on the part that the script looks for a match inside the file, because right now it has to go to each entry until it finds a match instead of going directly to a match (I didn't know how to do differently).

            Suggestions are welcome!

            Cheers,
            Gabriel.

            Comment


            • #51
              One soultion that I developed was having a table that was just :

              type | source | target

              Indexed from type and source.

              Where type is post, thread, user etc

              Target is the new id you want, and make that table, HEAP or MEMORY, that was dramatically faster than using vBulletin database and can be maintained with board with multi-imports with diffrent lookup tables depending on the redirect.

              Though what ever works satisfactorily is a good solution
              I wrote ImpEx.

              Blog | Me

              Comment


              • #52
                my import method was:

                imported phpbb to vbulletin at hold host, then move vbulletin to my new host, would that erase the importid?

                could that be the reason that this script isn't working for me?

                Comment


                • #53
                  if all went well, moving the database does not delete data in the database.

                  has the URL of your board changed?

                  Comment


                  • #54
                    yes

                    I imported my site here:

                    import.mysite.com

                    I couldn't do the import on my main site, 'cause it was still live

                    Comment


                    • #55
                      I have a phpbb forum that I am considering moving to vB. However, the forum is only part of the site. I have some static pages and a blog on the site too with an existing custom 404 page.

                      Will this solution work in this setup? It wasn't clear from the thread discussion if the solution allowed for a default 404 page if the URL being requested was not an old forum URL.

                      Also, did I understand correctly that the solution could be configured to send 301 permanently moved headers when the URL was an old forum URL and a corresponding page is found?
                      Project Management Knowledge Base
                      Project Planning Info

                      Comment


                      • #56
                        Never mind. I figured it out.

                        Jerry, the script is returning a 301 and 200 headers when forwarding to the default 404 page. Is there any way to have it send the 301 only when a matching vB page is found and return a 404 when resolving to the default 404 page?
                        Project Management Knowledge Base
                        Project Planning Info

                        Comment


                        • #57
                          Jerry, I was testing urls that do not pertain to the old forum (garbage files in the root directory for example) and they are not triggering the default 404 page. Only when I test for files in the old forum folder does the default 404 page get shown.

                          Also, the profile pages are not showing as expected (phpBB2).
                          Project Management Knowledge Base
                          Project Planning Info

                          Comment


                          • #58
                            I solved the problem with 301 headers to the 404 page for old forum URLs that could not be matched to the new forum by adding a if ($new_url == $standard_404) conditional inside the else block at the end of the code.

                            I'm still having a heck of a time trying to figure out why neither of these blocks work when their conditions are true:
                            PHP Code:
                            if ($debug)
                            {
                             echo "<html><head><title>404 debug</title></head><body>";
                             echo "<br>Action :: " .   $action;
                             echo "<br>SQL :: " .  $sql;
                             echo "<br>REQUEST_URI :: " . $_SERVER['REQUEST_URI'] ;
                             echo "</body></html>";
                             die;
                            }
                             
                            if (!$action)
                            {
                            ?>
                             <html>
                             <head>
                              <meta http-equiv="refresh" content="<? echo $refresh_speed?>;URL=<? echo $standard_404?>">
                             </head>
                             <body>
                             </body>
                             </html>
                            <?
                            If I enter a garbage URL or set $debug = true, I get the default browser 404 message and not the debug message or my custom 404 page (or that source code if I turn off meta refresh in my internet settings).

                            Any ideas?
                            Project Management Knowledge Base
                            Project Planning Info

                            Comment


                            • #59
                              I'm having the same exact problem as pmkb, but I can't figure it out a thing about this.

                              I guees the problem could have to do that phpbb was "inside" a phpnuke cms, so urls, are not like the example ones, could that be the reason why this is not working?

                              Comment


                              • #60
                                I found the problem. Per the wikipedia:
                                Internet Explorer (pre IE7), however, will not display custom pages unless they are larger than 512 bytes, opting to instead display a "friendly" error page.
                                So, I added this between the <body></body> tags in the sections for the 404 meta refresh:
                                Code:
                                <h1>Page Not Found</h1>
                                <p>If you are reading this, then you have META-REFRESH disabled in your browser's internet settings.</p><p>The page you requested could not be found. It has either never existed, been removed or moved to another path or filename.</p><p>Please try navigating to the information you want from the site's <a href="http://www.yourdomaingoeshere.com/">home page</a>.  There is a search function available for finding information in the forums.</p>
                                and it works now for everyone - including folks like me with screwy browsers.
                                Project Management Knowledge Base
                                Project Planning Info

                                Comment

                                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                                Working...
                                X