Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-07-2010, 09:01 PM
justoverclock justoverclock is offline
 
Join Date: Dec 2007
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default include php in template URL REWRITE

hi, i've created a new plugin for a php include (wordpress news into vbulletin)

all works fine (thx to lynne)

but now how can i make this url SEO FRIENDLY?

fetch_seo_url is the function? how can i do this step by step?
Reply With Quote
  #2  
Old 11-08-2010, 09:40 AM
Retal Retal is offline
 
Join Date: Nov 2006
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What URL are you talking about?
Reply With Quote
  #3  
Old 11-08-2010, 08:58 PM
justoverclock justoverclock is offline
 
Join Date: Dec 2007
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i've made a plugin to include the wordpress news in vbulletin

but this url are not rewrited.... (now you can't see the plugin because is disabled)
Reply With Quote
  #4  
Old 11-08-2010, 10:42 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you checked out the function either in the files or in the API (link in Quick Links)?
Reply With Quote
  #5  
Old 11-09-2010, 09:36 AM
justoverclock justoverclock is offline
 
Join Date: Dec 2007
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i don't understand lynne, i'm italian and i'm not a coder
Reply With Quote
  #6  
Old 11-09-2010, 02:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Go to the API here - http://members.vbulletin.com/api/ and click on functions and find fetch_seo_url . That should help you understand how the function works.
Reply With Quote
  #7  
Old 11-11-2010, 11:51 AM
justoverclock justoverclock is offline
 
Join Date: Dec 2007
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok i read this

HTML Code:
Converts raw link information into an appropriate URL Verifies that the requested linktype can be handled

void fetch_seo_url (string $link, array $linkinfo, [array $pageinfo = null], [string $primaryid = null], [string $primarytitle = null])
string $link: Type of link, 'thread', etc
array $linkinfo: Specific information relevant to the page being linked to, $threadinfo, etc
array $pageinfo: Other information relevant to the page being linked to
string $primaryid: Override the default $linkinfo[userid] with $linkinfo[$primaryid]
string $primarytitle: Override the default $linkinfo[title] with $linkinfo[$primarytitle]
now the question is?.this code should go in the plugin? in the template? in my file.php?
Reply With Quote
  #8  
Old 11-11-2010, 02:13 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's a function you call with php. If the function were called "myfunction" and it accepted two inputs, you would call it like:

$newname = myfunction($var1, $var2);

Do a search through the vbulletin files for other calls to the function ("fetch_seo_url") and you'll get 294 hits. That's 294 good examples of how to use that function.
Reply With Quote
  #9  
Old 11-11-2010, 05:26 PM
justoverclock justoverclock is offline
 
Join Date: Dec 2007
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not work for me, this is an example from a coder of vbseo.com but i get a fatal error:

"you have to do something like this" in your file.php
PHP Code:
 include_once 'includes/functions_vbseo.php'

//the rest of your query stuff here
while($records){
$threadurl vbseo_thread_url_row($records[threadID], 1);

i try but i have an error, this is my clean file.php (without this mod) anyone know where i put the code?

it's so difficult for me twice because i'm not english...


PHP Code:
<? 

require("inclusion.config.php"); 



$connessione=mysql_connect($dbss_server, $dbss_username, $dbss_passwd); 
$dbss = mysql_select_db($dbss_name, $connessione); 
?> 
<link rel="stylesheet" type="text/css" href="inclusion.css"> 
<table width="100%" cellpadding="0" cellspacing="0" class="inc_tbl1"> 
    <tr>    
        <td height="30" align="center" valign="middle" class="inc_tbl1_title" style="width:40%"> 
            <?=$inc_title1?> 
        </td> 
        <td style="width:30%" valign="middle" align="center" class="inc_tbl1_title">   
            <?=$inc_title2?> 
  </td> 
        <td style="width:30%" valign="middle" align="center" class="inc_tbl1_title"> 
            <?=$inc_title3?> 
        </td> 
    </tr> 
    <tr> 
        <td style="width:<?=$wCol1?>" valign="top"> 
            <table width="100%" cellpadding="0" cellspacing="0"> 
                <tr> 
                <? 
                unset($noId); 
                $qLastArticle = mysql_query("SELECT ID, post_content, post_title, guid FROM $tbl_post_wp  WHERE post_status = 'publish' AND post_parent = '0' ORDER BY post_date DESC LIMIT $n_last_article");   
                while($rLastArticle = mysql_fetch_assoc($qLastArticle)){ 
                 
                     
                    $noId .= " AND id!= '$rLastArticle[ID]' "; 

                    $qLastArticleImg = mysql_query("SELECT guid FROM $tbl_post_wp  WHERE post_mime_type LIKE 'image/%' AND post_parent = '$rLastArticle[ID]' ORDER BY post_date ASC LIMIT 1");   
                    $rLastArticleImg = mysql_fetch_assoc($qLastArticleImg); 
                ?> 
                    <td style="padding:2px"> 
                        <a href="<?=$rLastArticle[guid]?>"><b><?=$rLastArticle[post_title]?></b></a> 
                        <div style="clear:both;height:5px"></div> 
                        <div id="LastArticle"> 
                        <? 
                        if($rLastArticleImg[guid] != ""){ 
                        ?> 
                        <div id="imgLastArticle"> 
                            <img src="<?=$base?>phpThumb/phpThumb.php?src=<?=$rLastArticleImg[guid]?>&w=<?=$img_width?>&h=<?=$img_height?>&q=100"> 
                        </div> 
                        <?                         
                        } 
                        ?>    
                     
                            <?=substr(strip_tags($rLastArticle[post_content]),0,$lengthLastArticle)?>... 
                        </div> 
                    </td> 
                <? 
                } 
                ?> 
                </tr> 
            </table> 
        </td> 
        <td style="width:<?=$wCol2?>" valign="top"> 
            <table width="100%" cellpadding="0" cellspacing="0" class="inc_tbl2"> 
        <? 
        $qTenArticle = mysql_query("SELECT ID, post_title, guid FROM $tbl_post_wp  WHERE post_status = 'publish' AND post_parent = '0' $noId ORDER BY post_date DESC LIMIT 10");   
        while($rTenArticle = mysql_fetch_assoc($qTenArticle)){ 
             
            ?> 
             
                <tr> 
                    <td><a href="<?=$rTenArticle[guid]?>"><b><?=$rTenArticle[post_title]?></b></a></td> 
                </tr> 
            <?     
        } 
        ?> 
            </table> 
        </td> 
        <td style="padding-left:5px" "width:<?=$wCol3?>" valign="top" > 
        <a href="http://www.justoverclock.com/recensioni/modding" title="Modding" target="_blank">Modding</a><br> 
      <a href="http://www.justoverclock.com/overclock-cpu-e-hardware" title="overclock" target="_blank">Overclock</a><br> 
      <a href="http://www.justoverclock.com/liquid-cooling-raffreddamento-a-liquido" title="liquid cooling" target="_blank">Liquid Cooling</a><br> 
      <a href="http://www.justoverclock.com/telefonia-e-tablet-pc" title="telefonia e tablet pc" target="_blank">Telefonia e Tablet PC</a><br> 
      <a href="http://www.justoverclock.com/recensioni" title="Recensioni e test" target="_blank">Recensioni e test</a><br> 
      <a href="http://www.justoverclock.com/schede-video-ati-nvidia-zotac-sapphire-xfx" title="Schede video" target="_blank">Schede Video</a><br> 
      <a href="http://www.justoverclock.com/cpu-ram" title="cpu e ram" target="_blank">Cpu e Ram</a><br> 
      <a href="http://www.justoverclock.com/generale" title="hardware generale">Generale</a><br> 
      <a href="http://www.justoverclock.com/storage-e-periferiche" target="_blank">Periferiche</a><br> 
      <a href="http://www.justoverclock.com/news-videogiochi" target="_blank">Videogiochi</a> 

        </td> 
    </tr> 
</table>
Reply With Quote
  #10  
Old 11-11-2010, 08:09 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That is a vbseo function, so you will have to ask them for help as I know nothing about that function.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:54 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09103 seconds
  • Memory Usage 2,284KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete