9
   

phpBB Search Engine Optimization - Sessions, static ( SEO )

 
 
J R Miller
 
  1  
Sun 11 Apr, 2004 10:29 am
I have the same problem as 993ti...
0 Replies
 
zoomsan
 
  1  
Sun 11 Apr, 2004 01:45 pm
hello,

if i were to want to change my viewforum & viewtopic files as has been discussed with editpad lite, and i had to change all of my forum files - should i obviously include all template files and every single forum file? i just want to be sure before i undertake this. i assume it would just be as simple as opening every single file in editpad lite and then using the mass search and replace, correct? and then of course re-naming the originals.

also, if i wanted to change my /forum folder name - the root - to something more SEO specific, without having to completely re-install etc, is that possible? i assume i could do the editpad lite thing again, the same way - my current folder is called /community - and search and replace?

the question on that second part tho is the fact that you can edit that root path in the admin configuration - and i am not sure where that fits in etc - if it calls to a database or something - i dont want to screw the DB up.

thanks in advance for any insight!

zm
0 Replies
 
Craven de Kere
 
  1  
Sun 11 Apr, 2004 04:59 pm
993ti and J. R. Miller,

The RewriteRule ^forums.* index.php like is to allow forums.html to go to your index.php page. See ( http://www.able2know.com/forums/forums.html ).

It's not related to the subdirectory.

2 tips:

1) the example code goes inside the phpBB root directory.

2) It won't work with IP based access in most cases.

If you guys are accessing it through a domain based URL, and getting the error please PM me the URLs.
0 Replies
 
Craven de Kere
 
  1  
Sun 11 Apr, 2004 05:06 pm
zoomsan wrote:
hello,

if i were to want to change my viewforum & viewtopic files as has been discussed with editpad lite, and i had to change all of my forum files - should i obviously include all template files and every single forum file? i just want to be sure before i undertake this. i assume it would just be as simple as opening every single file in editpad lite and then using the mass search and replace, correct? and then of course re-naming the originals.


Skip this if you can use the static URLs in the mod_rewrite code I posted yesterday.

The ability to use mod_rewrite is much much better than renaming as you can also spoof static html pages.

Quote:
also, if i wanted to change my /forum folder name - the root - to something more SEO specific, without having to completely re-install etc, is that possible? i assume i could do the editpad lite thing again, the same way - my current folder is called /community - and search and replace?


Editpad is a text editor and will not be able to move your forum to a new directory on your server as it can only change text, not move files.

It's possible to do, of course without losing your existing data but you need to make the new directory and upload the files etc.

Alternately you can change the directory with mod_rewrite and fake it, but I recommend that you pick something that won't change and stick with it.

Quote:
the question on that second part tho is the fact that you can edit that root path in the admin configuration - and i am not sure where that fits in etc - if it calls to a database or something - i dont want to screw the DB up.


The config.php file has the DB connection data. Try this:

1) create a new directory on your server with the name you want.

2) Copy all your forum files over (do not move, copy).

3) Make sure the new directory has the same config,php file.

4) See what happens next, and iron out any kinks before removing the old forum directory and repointing the links.
0 Replies
 
zoomsan
 
  1  
Mon 12 Apr, 2004 12:05 pm
something i have been struggling with for a while is integrating this great mod with what i use to display recent topics on my index page. it is probably something quite simple.

what i did do was to copy the .htaccess file from the forums root into my site root.

also, i copied the function that was in page_header.php into the file i call with an include from my index page. ~ at the beginning.

i see that it will open a buffer.

i assume that it gathers the contents then of the php file which gets the recent topics fromt he database - and more importantly the rouge viewtopic URLs.

after the echo i close the DB and then insert the code that went in page_tail.php - to close the buffer, clear it, call the function and i guess correct the URLs and rewrite them.

however, my index page still shows the un-rewritten URLs! i have screwed with this for a while. i understand its not part of the mod, but if anyone has any ideas i would appreciate it. like i said, probably something simple.

also, i was thinking that i should De-Link the link to the user's profile I had on my index page - similar to the theme of this Mod. however, i am wondering that since i believe profile.php is excluded in the robots.txt file of this Mod - is it neccessary? or would it help to disable it?

finally, i googled etc - what is this global variable - i cant find just a quick descrip - (what does it do):
global $dbg_starttime;

here is my code for the included file from my index page in the site root:

Code:
<?php
// ############ Edit below ###############################
$length = '20'; // length of topic title
$limit = '10'; // how many topics?
$l_recent = 'Recent Posts:';
$l_started = '<';
$l_by = 'by';
$special_forums = '0'; // 0 = no; 1 = yes
$forums = '1,2,3'; // ID of forums; separate them with a comma
// ############ Edit above ###############################

if ( !$userdata['session_logged_in'] )
{
ob_start();
}

function replace_for_mod_rewrite(&$s)
{
$urlin =
array(
"'(?<!/)viewforum.php\?f=([0-9]*)&topicdays=([0-9]*)&start=([0-9]*)'",
"'(?<!/)viewforum.php\?f=([0-9]*)&mark=topics'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&watch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&unwatch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&highlight=*'",
"'(?<!/)viewforum.php\?f=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=previous'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=next'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&vote=viewresult'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&highlight=([a-zA-Z0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)'",
"'(?<!/)viewtopic.php&p=([0-9]*)'",
"'(?<!/)viewtopic.php\?p=([0-9]*)'",
);
$urlout = array(
"topic-\\1-\\2-\\3.html",
"mark-forum\\1.html",
"updates-topic\\1.html",
"stop-updates-topic\\1.html",
"about\\1.html&highlight=\\2",
"forum-\\1.html",
"ptopic\\1.html",
"ntopic\\1.html",
"view-poll\\1-\\2-\\3.html",
"about\\1-\\2-\\3-\\4.html",
"about\\1.html",
"about\\1-\\2.html",
"about\\1.html",
"post-\\1.html",
"post-\\1.html",
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}

echo "<h2 class=\"posts\">$l_recent</h2>";

$sql = "SELECT post_id FROM ". POSTS_TABLE;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain matched posts list.', '', __LINE__, __FILE__, $sql);
}
$recent_ids = array();
while( $row = $db->sql_fetchrow($result) )
{
$recent_ids[] = $row['post_id'];
}
$db->sql_freeresult($result);

$recent_forum = ( isset($HTTP_POST_VARS['forum']) ) ? intval($HTTP_POST_VARS['forum']) : -1;
if ( $recent_forum == -1 )
{
$is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);
$ignore_forum_sql = '';
while( list($key, $value) = each($is_auth_ary) )
{
if ( !$value['auth_read'] )
{
$ignore_forum_sql .= ( ( $ignore_forum_sql != '' ) ? ', ' : '' ) . $key;
}
}
if ( $ignore_forum_sql != '' )
{
$auth_sql .= ( $auth_sql != '' ) ? " AND f.forum_id NOT IN ($ignore_forum_sql) " : "f.forum_id NOT IN ($ignore_forum_sql) ";
}
}
if ( $recent_author == '' && $auth_sql == '' )
{
$sql = "SELECT topic_id FROM ". POSTS_TABLE ."
WHERE post_id IN (" . implode(", ", $recent_ids) . ")
$where_sql GROUP BY topic_id";
}
else
{
$from_sql = POSTS_TABLE ." p";
if ( $auth_sql != '' )
{
$from_sql .= ", ". FORUMS_TABLE ." f";
$where_sql .= " AND f.forum_id = p.forum_id AND $auth_sql";
}
$sql = "SELECT p.topic_id FROM $from_sql
WHERE p.post_id IN (" . implode(", ", $recent_ids) . ")
$where_sql GROUP BY p.topic_id";
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topic ids', '', __LINE__, __FILE__, $sql);
}

$recent_ids = array();
while( $row = $db->sql_fetchrow($result) )
{
$recent_ids[] = $row['topic_id'];
}
$db->sql_freeresult($result);

$auth_results = implode(', ', $recent_ids);
$where_part1 = ( $special_forums == '0' ) ? 't.topic_id IN ('.$auth_results.')' : 'f.forum_id IN ('.$forums.')';

$sql = "SELECT t.*, f.forum_id, f.forum_name, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
FROM ". TOPICS_TABLE ." t, ". FORUMS_TABLE ." f, ". USERS_TABLE ." u, ". POSTS_TABLE ." p, ". POSTS_TABLE ." p2, ". USERS_TABLE ." u2
WHERE $where_part1
AND t.topic_poster = u.user_id
AND f.forum_id = t.forum_id
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND u2.user_id = p2.poster_id
ORDER BY t.topic_last_post_id DESC LIMIT $limit";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not obtain main information', '', __LINE__, __FILE__, $sql);
}
$line = array();
while( $row = $db->sql_fetchrow($result) )
{
$line[] = $row;
}
$db->sql_freeresult($result);

$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array();
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array();
for($i = 0; $i < count($line); $i++)
{
$topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $line[$i]['topic_id']);
$topic_id = $line[$i]['topic_id'];

$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
$word_censor = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $line[$i]['topic_title']) : $line[$i]['topic_title'];
$topic_title = ( strlen($line[$i]['topic_title']) < $length ) ? $word_censor : substr(stripslashes($word_censor), 0, $length) . "...";

$first_time = create_date($board_config['default_dateformat'], $line[$i]['topic_time'], $board_config['board_timezone']);
$first_author = ( $line[$i]['user_id'] != ANONYMOUS ) ? '<a class="topicsa" href="' . append_sid("".$phpbb_root_path."profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $line[$i]['user_id']) . '" class="genmed">'.$line[$i]['username'].'</a>' : ( ($line[$i]['post_username'] != '' ) ? $line[$i]['post_username'] : $lang['Guest'] );

echo "<span class=\"topics\"><a class=\"topicsa\" href=\"$phpbb_root_path$topic_url\">$topic_title</a>
<br />::$l_$first_time::<br />$l_by $first_author</span><br/><br/>";
}

echo "</table>";

$db->sql_close();

if ( !$userdata['session_logged_in'] )
{
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
global $dbg_starttime;
}
?>
0 Replies
 
Craven de Kere
 
  1  
Mon 12 Apr, 2004 12:07 pm
I plan to release SEO optimized portal/CMS code so I personally won't be supporting third party code for now.
0 Replies
 
zoomsan
 
  1  
Mon 12 Apr, 2004 01:58 pm
No probs Craven..

anyone else have any ideas? I just want to do this one thing, and don't need anything more/less...

thx in advance.

zm
0 Replies
 
Craven de Kere
 
  1  
Mon 12 Apr, 2004 02:05 pm
zoomsan,

Forget about adding my code and just change this line:

Code:$topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $line[$i]['topic_id'] );


All you need to do is make it write the topic ID into the html file. I'd give you the code but I don't remember what I used for the htaccess file in the mod. I think it's topic-ID.html

If so, that would be something like

Code:$topic_url = append_sid("topic-" . $line[$i]['topic_id'] . ".html");


That's just an example, I didn't read much of your code and it's written blindly. But you should be able to get the point.
0 Replies
 
993ti
 
  1  
Mon 12 Apr, 2004 03:04 pm
What i forgot to mention is that i'm also using the phpbb search engine indexer.
The pages of that (archive) do show up as html pages.
Now i'm totally confused. Embarrassed
0 Replies
 
Craven de Kere
 
  1  
Mon 12 Apr, 2004 03:07 pm
phpbb search engine indexer isn't a mod I recommend, as it's just duplicating all the content. It does have one very useful feature which is titles in the URL. I'll incorporate that soon and at that point there will be no need to have duplicate content (which search engines do not like).

But if those are working, it sounds like mod_rewrite IS working. Send me a URL again please.
0 Replies
 
zoomsan
 
  1  
Mon 12 Apr, 2004 03:12 pm
hey i think i recommended using the URL dashes in that mod instead of underscores! yayyy my contribution to the phpbb SEO deal.

hehehe. small, but im starting come on.

yes craven you were right on - only in the mod for topics you used about5.html for example - if anyone else cares. hehe.

also, i am just wondering about the dilloution factor that could exist from linking to things like a profile somewhere even if its in robots.txt and google wouldnt follow it.

it would appear it would be okay to link to think like this then, is that sound logic? also for example - even if you put search.php in the robots.txt, doing the mod that links a user's name to their post history just because you like the feature and want it. would this also not neccessarily hurt the SEO since it's in the robots.txt?

peace in the mideast.

zm
0 Replies
 
Craven de Kere
 
  1  
Mon 12 Apr, 2004 03:17 pm
There are different kinds of dillution, PR flow dillution and content dillution.

The HTMl archive with the search engine indexer for example is content dillution, it has a bunch of duplicate content and the search engine might think there's some monkey business going on.

I didn't realize I'd done the "about" links. I'd intended to change it to something more generic. But oh well.

Can anyone confirm that my static URL mod is working for them? Please PM me a link or two.
0 Replies
 
J R Miller
 
  1  
Tue 13 Apr, 2004 12:09 pm
my url is linked in my profile, but I took the MOD out for now until I have some time to work on it. I will watch this week to see if the problem pops up with anyone else and next week, when I have time, I will try it again and let you know of any problems.
0 Replies
 
Craven de Kere
 
  1  
Tue 13 Apr, 2004 01:03 pm
JR, if either yourself or 993ti want to give me temorary (must be temporary, I do **not** want access to any permanent passwords) FTP access I can try to take a look.
0 Replies
 
J R Miller
 
  1  
Tue 13 Apr, 2004 01:56 pm
It is not too convenient for me to set up a temporary FTP account (the guy who helps me is very busy). I will try and get to this soon though becuase I know it is helpful for you to make sure your code works on a variety of systems. I also really appreciate your offer to help. That is very kind of you.
0 Replies
 
Superdairyboy
 
  1  
Tue 13 Apr, 2004 09:54 pm
J.R. Mentioned removing the Who's online...

We'll since starting our PHP Board I find that I keep find Boards to Join and Ask questions. With being Members of so many boards I find that it is easy to get lost. as in what part did I make that post..... So I always go to the forum and click on my name at the bottom and then view all posts. I find it very convient.

Just my 2 cents

Dairyboy
0 Replies
 
Craven de Kere
 
  1  
Wed 14 Apr, 2004 12:30 am
The latest mod version does not remove it, it just hides it from guests/spiders.
0 Replies
 
webtrends
 
  1  
Thu 15 Apr, 2004 10:31 am
v 2.0.8 session mgmt question
Code:
#
#-----[ OPEN ]------------------------------------------
#

includes/sessions.php

#
#-----[ FIND ]------------------------------------------
#

$SID = 'sid=' . $session_id;

#
#-----[ REPLACE WITH ]------------------------------------------
#

if ( $userdata['session_user_id'] != ANONYMOUS ){
$SID = 'sid=' . $session_id;
} else {
$SID = '';
}



In version 2.0.8 there is no
Code:$SID = 'sid=' . $session_id;
part

and I am not sure how to make the modifications.

Any help is greatly appreciated

Thx.
0 Replies
 
Craven de Kere
 
  1  
Thu 15 Apr, 2004 11:31 am
Yes there is. It's on line 185.
0 Replies
 
webtrends
 
  1  
Thu 15 Apr, 2004 11:39 am
Craven de Kere wrote:
Yes there is. It's on line 185.


Hi Craven,

thanks for the quick response.

It says

Code:
$SID = ( $sessionmethod == SESSION_METHOD_GET ) ? 'sid=' . $session_id : '';


on line 185. But now I know what to change :wink:

Klaus
0 Replies
 
 

Related Topics

SEO - Going from 0 PR on up - Discussion by jespah
How Rich Pins work ??? - Question by OnceUponAtime
Need a bit of Google advice - Question by bible quizzer
Google Indexing Issue - Question by brainstudioz
Bing Search results - Discussion by iankyra
What is best way for Off-Page seo in 2017? - Question by honesttravel1
 
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 05/02/2024 at 12:09:14