vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Show Thread Enhancements - Replace URL's With Page Title (https://vborg.vbsupport.ru/showthread.php?t=155909)

Jafo232 12-10-2007 02:03 AM

Hmm, I assume you will have to edit a template or a VB setting to use the threads title for the page title.. I kinda thought they all did already, but maybe your template needs updating..

karnevil 12-10-2007 11:18 AM

Thanks Jafo - been trying to work it out for ages and have got completely nowhere.

Heres how the links come up

http://www.legalbeagles.info/forums/...ead.php?t=3539

On VB org they come up as

https://vborg.vbsupport.ru/showthrea...=155909&page=7

On another site where it does work they come up as

http://www.consumeractiongroup.co.uk...olicitors.html


Thats what I want mine to do....

karnevil 12-10-2007 12:30 PM

Ahhh think we ran out of VBSEO.... :(

Is that the only way to do it ?

Jafo232 12-10-2007 04:03 PM

Not sure what is happening, because the site you link to isn't online..

Jafo232 12-19-2007 04:11 AM

Quote:

Originally Posted by karnevil (Post 1398524)
Ahhh think we ran out of VBSEO.... :(

Is that the only way to do it ?

I have no idea what you are saying.

Satz 12-19-2007 11:06 AM

i tried everythin..still no luck for me :(

there is no way otherthan buying VBseo ? for Title_based_url.html ?

katan 12-19-2007 03:48 PM

thanks you!!!

Jafo232 12-19-2007 04:29 PM

Quote:

Originally Posted by Satz (Post 1404468)
i tried everythin..still no luck for me :(

there is no way otherthan buying VBseo ? for Title_based_url.html ?

This mod does not create title_based_url.html. Your misunderstand it.

sweede 12-19-2007 05:08 PM

Go to the admin CP

Plugins & Products -> Plugin Manager

Look for "Product : Title Replace"

Edit the plugin labeled Title Replace
Replace the contents of the Plugin PHP Code with the code below.

The code below does NOT use cURL or fopen and does not run into the problem of either cURL not being installed or hosts that have URL opens with fopen disabled.

fsocketopen will retrieve the first 8k of the HTML file to look for the <title></title> tags. if it does not find them, it will end the connection and return the pasted URL as is.

I should warn you that i havent tested this code for basic PHP Errors. it would be wise to copy the existing plugin PHP Code to notepad for a backup before pasting the code below.

-- See my post below with the change that uses fread() opposed to while(!feof(resource) )

Jafo232 12-19-2007 05:36 PM

This above code entry does NOT just open the first 8k.. Consider:

Code:

<?php
error_reporting(E_ALL);

function auto_title_http_get($url){

        $url_stuff = parse_url($url);
        $port = isset($url_stuff['port']) ? $url_stuff['port'] : 80;

        $fp = fsockopen($url_stuff['host'], $port);

        $query  = "GET " . $url_stuff['path'] ."?". $url_stuff['query'] . " HTTP/1.0\n";
        $query .= "Host: " . $url_stuff['host'];
        $query .= "\n\n";

        fwrite($fp, $query);

        while ($tmp = fread($fp, 8192))
        {
            $buffer .= $tmp;
        }

        preg_match('/Content-Length: ([0-9]+)/', $buffer, $parts);

        return substr($buffer, - $parts[1]);

    }


echo auto_title_http_get('http://fedora.inode.at/6/i386/iso/FC-6-i386-DVD.iso');

?>

And watch your servers memory get gobbled up and and PHP timeout.. Hence why fopen is preferred.


All times are GMT. The time now is 07:53 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02499 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete