Register Arama Bugünkü Mesajlar Mark Forums Read

Reply
 
Thread Tools
vBulletin 4 Template Syntax: Links
vB.Org Poster
vB.Org Poster has disabled reputation
Kayıt Tarihi: Jul 2018
Mesajlar: 298

Show Printable Version Email this Page
Makale: vBulletin 4 Makaleleri, yazar vB.Org Poster 09 Jul 2018, 23:55

This article was created by Freddie Bingham on vB.com and reposted here with his permission:

In vBulletin 4.0, we will support friendly URL for SEO and readability purposes. At the present, we support member, thread, and forum links. I expect that this list will grow to include albums, etc before the release date. You need to be aware of the new format for outputting these urls.

TEMPLATES

When you wish to use a url in a template the format is as follows:

Kod Blok Kilitli:      (Kayıt veya giriş yapmalısın)  
Engellenmiş, kayıtlı olmayan veya onay bekleyen kişiler kodlara erişemezler.

link never changes

The second argument is a string that notifies the system which type of URL is to be output. The valid types are thread, forum, and member

The third argument is an array that contains the id and title, at minimum, of the link to be generated. For thread, this would be threadid and title. For forum this would be forumid and title. For member this would be userid and username.

The fourth argument is an optional array that contains any arguments that are required to be sent along, such as perpage (pp), page (pagenumber), order, and so on.

The simplest forms are:

Kod Blok Kilitli:      (Kayıt veya giriş yapmalısın)  
Engellenmiş, kayıtlı olmayan veya onay bekleyen kişiler kodlara erişemezler.

If you have an array containing the id and title but they do not follow the conventional naming conventions, then you may specify their names with the fifth and sixth options. Both must be specified for them to be recognized. For example, you have $post[threadid] and $post[threadtitle] and wish to output a thread url. You would use:

Kod Blok Kilitli:      (Kayıt veya giriş yapmalısın)  
Engellenmiş, kayıtlı olmayan veya onay bekleyen kişiler kodlara erişemezler.

null was specified for the $pageinfo argument array since this example had no arguments.

If you wish to output a url that uses & instead of & for arguments, for javascript, append "|js" to your type argument so that thread becomes thread|js, member becomes member|js. If you wish to not output a sessionhash, in any instance, say for a url in an email, append nosession to the type argument, so that thread becomes thread|nosession

EXAMPLES

To output a link to a post, you could use

Kod Blok Kilitli:      (Kayıt veya giriş yapmalısın)  
Engellenmiş, kayıtlı olmayan veya onay bekleyen kişiler kodlara erişemezler.

$pageinfo_lastpost would appear like:

Kod Blok Kilitli:      (Kayıt veya giriş yapmalısın)  
Engellenmiş, kayıtlı olmayan veya onay bekleyen kişiler kodlara erişemezler.

PHP

When creating a link in the code, use the fetch_seo_url function, which accepts the same arguments.

function fetch_seo_url(string, array, array, string, string)

In fact the {vb:link thread, $threadinfo, $pageinfo} syntax is just replaced with fetch_seo_url() when a template is compiled.

EXAMPLES

Infractions tab of a user's profile

Kod Blok Kilitli:      (Kayıt veya giriş yapmalısın)  
Engellenmiş, kayıtlı olmayan veya onay bekleyen kişiler kodlara erişemezler.

Using the mod rewrite output, $memberurl would be /members/123-freddie?tab=infractions

Please be aware of this change and use it as needed in 4.0. Please refer to the code for exact examples if I have just confused you.
Views: 15
Reply With Quote
Reply

Thread Tools

Şunları Yapabilirsin
Yeni Konu Açmak
Konuya Cevap Yazmak
Eklenti Eklemek
Düzenleme Yapabilmek

Forum Atla


New To Site? Need Help?

All times are GMT +3. The time now is 15:46.

Tasarım Özelliği | Genişlik: Geniş Renk: vBulletin 4 Template Syntax: Links vBulletin 4 Template Syntax: Links vBulletin 4 Template Syntax: Links vBulletin 4 Template Syntax: Links vBulletin 4 Template Syntax: Links