Google

NukeCoder


View next topic
View previous topic
Post new topic   Reply to topic
Author Message
gotcha
Site Admin
Site Admin



Joined: Oct 25, 2004
Posts: 700

PostPosted: Sun Mar 18, 2007 5:53 am Reply with quote

This will show you how to get forum topic titles into your Google Tapped links. The rewrites are based on the last GT-nextgen release and may need modification for other versions. Backup your files before making any changes.

Files to edit: 4
Difficulty: Easy

Open -> modules/Forums/nukebb.php

Find:
 include("header.php"); 

After, ADD on a new line:
 function gt_url($url_in)
{
  
$url_in trim(str_replace(array('exec''union''.'), ''$url_in));
  
$url_out preg_replace('/[^a-z0-9_\-\.]/i''_'$url_in);
  unset(
$url_in);
  return 
preg_replace('/[_]{2,}/''_'$url_out);


End -> modules/Forums/nukebb.php
_______________________________________

Open -> modules/Forums/viewforum.php

Find:
 $goto_page .= '<a href="' append_sid("viewtopic.$phpEx?" POST_TOPIC_URL "=" $topic_id "&start=$j") . '">' $times '</a>'

Change to:
 $goto_page .= '<a href="' append_sid("viewtopic.$phpEx?" POST_TOPIC_URL "=" $topic_id "&start=$j&title=".gt_url($topic_rowset[$i]['topic_title'])) . '">' $times '</a>'


Find:
 $view_topic_url append_sid("viewtopic.$phpEx?" POST_TOPIC_URL "=$topic_id"); 

Change to:
 $view_topic_url append_sid("viewtopic.$phpEx?" POST_TOPIC_URL "=$topic_id&title=".gt_url($topic_rowset[$i]['topic_title']) ); 


Find:
 $last_post_url '<a href="' append_sid("viewtopic.$phpEx?"  POST_POST_URL '=' $topic_rowset[$i]['topic_last_post_id']) . '#' $topic_rowset[$i]['topic_last_post_id'] . '"><img src="' $images['icon_latest_reply'] . '" alt="' $lang['View_latest_post'] . '" title="' $lang['View_latest_post'] . '" border="0" /></a>'

Change to:
 $last_post_url '<a href="' append_sid("viewtopic.$phpEx?"  POST_POST_URL '=' $topic_rowset[$i]['topic_last_post_id']) .'&title='.gt_url($topic_rowset[$i]['topic_title']) . '#' $topic_rowset[$i]['topic_last_post_id'] . '"><img src="' $images['icon_latest_reply'] . '" alt="' $lang['View_latest_post'] . '" title="' $lang['View_latest_post'] . '" border="0" /></a>'

End -> modules/Forums/viewforum.php
_______________________________________

Open -> .htaccess

Add the following 3 rewrite rules to your forum section:
Code:

RewriteRule ^ftopic-([0-9]*)-([0-9]*)-([A-Za-z0-9_-]*).html modules.php?name=Forums&file=viewtopic&t=$1&start=$2&title=$3 [L]
RewriteRule ^ftopic(t|p)-([0-9]*)-([A-Za-z0-9_-]*).html modules.php?name=Forums&file=viewtopic&$1=$2&title=$3 [L]
RewriteRule ^ftopic(t|p)-([0-9]*)-([A-Za-z0-9_-]*).html#([0-9]*) modules.php?name=Forums&file=viewtopic&$1=$2&title=$3#$4 [L]


End -> .htaccess
_______________________________________

Open -> GoogleTap/GT-Forums.php

Insert the lines marked in the code below:
This is only part of the $urlin array...
 $urlin = array(
"'(?<!/)modules.php\?name=Forums&file=viewtopic&t=([0-9]*)&start=([0-9]*)&postdays=([0-9]*)&postorder=(desc|asc)&highlight=([A-Za-z0-9_-]*)'",
"'(?<!/)modules.php\?name=Forums&file=viewtopic&t=([0-9]*)&postdays=([0-9]*)&postorder=(desc|asc)&start=([0-9]*)'",
"'(?<!/)modules.php\?name=Forums&file=viewtopic&t=([0-9]*)&start=([0-9]*)&title=([a-zA-Z0-9-_]*)'",//add#1
"'(?<!/)modules.php\?name=Forums&file=viewtopic&t=([0-9]*)&start=([0-9]*)'",
"'(?<!/)modules.php\?name=Forums&file=viewtopic&t=([0-9]*)&view=(previous|next)'",
"'(?<!/)modules.php\?name=Forums&file=viewtopic&(t|p)=([0-9]*)&highlight=([A-Za-z0-9_-]*)'",
"'(?<!/)modules.php\?name=Forums&file=viewtopic&t=([0-9]*)&(watch|unwatch)=topic&start=([0-9]*)'",
"'(?<!/)modules.php\?name=Forums&file=viewtopic&(t|p)=([0-9]*)((\")|(&sid=[a-zA-Z0-9]*))'",
"'(?<!/)modules.php\?name=Forums&file=viewtopic&(t|p)=([0-9]*)#([0-9]*)((\")|(&sid=[a-zA-Z0-9]*))'",
"'(?<!/)modules.php\?name=Forums&file=viewtopic&(t|p)=([0-9]*)&title=([a-zA-Z0-9-_]*)((\")|(&sid=[a-zA-Z0-9]*))'"// add#2
"'(?<!/)modules.php\?name=Forums&file=viewtopic&(t|p)=([0-9]*)&title=([a-zA-Z0-9-_]*)#([0-9]*)((\")|(&sid=[a-zA-Z0-9]*))'"// add#3
"'(?<!/)modules.php\?name=Forums&file=profile&mode=editprofile'",
"'(?<!/)modules.php\?name=Forums&file=profile&mode=viewprofile&u=([0-9]*)'"


This is only part of the $urlout array...
 $urlout = array(
"ftopic-\\1-\\2-days\\3-order\\4-\\5.html",
"ftopic-\\1-days\\2-order\\3-\\4.html",
"ftopic-\\1-\\2-\\3.html",//add#1
"ftopic-\\1-\\2.html",
"ftopic-\\1-\\2.html",
"ftopic\\1-\\2-\\3.html",
"ftopic-\\1-\\2-\\3.html",
"ftopic\\1-\\2.html\\3",
"ftopic\\1-\\2.html#\\3\\4",
"ftopic\\1-\\2-\\3.html\\4",//add#2
"ftopic\\1-\\2-\\3.html#\\4\\5",//add#3
"forum-editprofile.html",
"forum-userprofile-\\1.html"


Save and close all files.
End Mod.

Check out this post to find out how to get the forum name into the url:
http://nukecoder.com/ftopict-367-Forum_Name_in_URL_with_Google_Tap.html
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT + 10 Hours
Forums ©