What is the Algorithm of SEF URL?
#1
I want to fetch a specific post from mybb_posts table and want to display url of that post. Currently I am using this method:
echo " <a href='http://www.example.com/showthread.php?tid=". $row[tid] ."&pid=". $row[pid] ."#pid". $row[pid] ."' target='_blank' class='linkstyle'>";
	echo $row[subject] ."</a><br>";

This is working fine for normal urls, But how to do it when forum is gzip compresed. In this case URLs are:
http://www.example.com/thread-192-post-654.html#pid654

So how do accomplish this task?
www.vubscs.com ( A new way of Mybb)
Reply
#2
I don't understand what gzip compression has to do with urls.

the link would look like:
http://www.example.com/thread-". $row[tid] ."-post-". $row[pid] .".html#pid". $row[pid] ."

Just keep in mind that's just a rough guess but it should work.
Reply
#3
Use the get_thread() function.
Reply
#4
http://www.example.com/thread-192-post-654.html#pid654

Thread ID
Post ID
--Pyridine
Reply
#5
get_post_link($pid, $tid=0) ?
All my plugins are available for free at MyBB Extend and on my GitHub. MyBB-Plugins.com has been closed and none of my plugins are officially maintained or supported.
Reply
#6
Thankx guys solved Big Grin
btw what are the arguments of get_thread() function?
www.vubscs.com ( A new way of Mybb)
Reply
#7
(2011-08-01, 06:55 PM)sunjava1 Wrote: Thankx guys solved Big Grin
btw what are the arguments of get_thread() function?

/**
4870   * Get the thread of a thread id.
4871   *
4872   * @param int The thread id of the thread.
4873   * @param boolean Whether or not to recache the thread.
4874   * @return string The database row of the thread.
4875   */
4876  function get_thread($tid, $recache = false)

In the future, use this extremely useful tool: http://crossreference.mybboard.de/nav.ht...index.html

It's well worth a bookmark.
Reply
#8
This user has been denied support. This user has been denied support.
look for get_*_link() in inc/functions.php, in your case I guess get_post_link($pid, $tid).

It does not actually return the #pid{$pid} part so you have to append that yourself...


gzip compression does not matter whatsoever
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)