##############################################################
## MOD Title: Spyder Manage
## MOD Author: netclectic < EMAIL REMOVED BY ADMIN > (Adrian Cockbutn) http://www.netclectic.com
## MOD Description: Adds a page which lists all topics with a link to viewtopic (without a session id).
## Also adds dynamic meta keywords to viewtopic.
## MOD Version: 0.9.0 BETA
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: (2) page_header.php, overall_footer.php
## Included Files: (2) spyder_manage.php, spyder_manage_body.tpl
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Author Notes:
##
## This mod assumes you have already installed...
##
## [*] the enhance-google-indexing mod
## [*] and the GoogleSingleSession mod
##
## both of which are available here - http://www.phpbb.com/phpBB/viewtopic.php?p=252424
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------
#
copy spyder_manage.php to spyder_manage.php
copy spyder_manage_body.tpl to templates/subSilver/spyder_manage_body.tpl
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
define('HEADER_INC', TRUE);
#
#-----[ AFTER, ADD ]------------------------------------
#
// add meta tags - we only want to do this for searchbots
if ( isset($HTTP_GET_VARS[POST_TOPIC_URL]) )
{
$topic_id = intval($HTTP_GET_VARS[POST_TOPIC_URL]);
}
else if ( isset($HTTP_GET_VARS['topic']) )
{
$topic_id = intval($HTTP_GET_VARS['topic']);
}
if ( $topic_id && ($userdata['session_id'] == md5(d8ef2eab)) )
{
$sql = "SELECT c.cat_title, f.forum_name, t.topic_title
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c
WHERE f.forum_id = t.forum_id
AND c.cat_id = f.cat_id
AND t.topic_id = $topic_id";
if( ($result = $db->sql_query($sql)) )
{
if ( $meta_row = $db->sql_fetchrow($result) )
{
$meta_description = '<meta name=description content="' . $meta_row['cat_title'] . ' :: ' . $meta_row['forum_name'] . ' :: ' . $meta_row['topic_title'] . '">';
}
}
$sql = "SELECT w.word_text
FROM " . TOPICS_TABLE . " t, " . SEARCH_MATCH_TABLE . " m, " . SEARCH_WORD_TABLE . " w
WHERE t.topic_first_post_id = m.post_id
AND m.word_id = w.word_id
AND w.word_common = 0
AND t.topic_id = $topic_id";
if( ($result = $db->sql_query($sql)) )
{
$meta_keywords = '';
while ( $meta_row = $db->sql_fetchrow($result) )
{
$meta_keywords .= ($meta_keywords=='') ? $meta_row['word_text'] : ',' . $meta_row['word_text'];
}
$meta_keywords = '<meta name=keywords content="' . $meta_keywords . '">';
}
}
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_footer.tpl
#
#-----[ FIND ]------------------------------------------
#
phpBB Group
#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
<a href="spyder_manage.php" class="gensmall">.</a>
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#
# EoM
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr><td><a href="{U_INDEX}" class="nav">{L_INDEX}</a></td></tr>
</table>
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr><th class="thTop">{L_CAT}</th>
<th class="thTop">{L_FORUM}</th>
<th class="thTop">{L_TOPIC}</th>
</tr>
<!-- BEGIN topic_row -->
<tr><td class="cat"><a href="{topic_row.CAT_URL}" class="cattitle">{topic_row.CAT_TILE}</a></td>
<td class="cat"><a href="{topic_row.FORUM_URL}" class="cattitle">{topic_row.FORUM_NAME}</a></td>
<td class="cat"><a href="{topic_row.TOPIC_URL}" class="cattitle">{topic_row.TOPIC_TITLE}</a></td>
</tr>
<tr><td colspan="3" class="row1"><span class="genmed">{topic_row.POST_TEXT}</tr>
<tr>
<td class="row2" align="left" colspan="2"><span class="genmed">{L_REPLIES}: {topic_row.TOPIC_REPLIES}</span></td>
<td class="row2" align="right"><span class="genmed"><a href="{topic_row.LAST_POST}" class="genmed">{L_LASTPOST}</a></span></td>
</tr>
<!-- END topic_row -->
<!-- BEGIN switch_more -->
<tr><td colspan="3" class="row3" align="right"><a href="{NEXT_URL}" class="gen">{L_NEXT}</a></td></tr>
<!-- END switch_more -->
</table>
<?php
/***************************************************************************
* spyder_manage.php
* -------------------
* Author : netclectic - Adrian Cockburn - EMAIL REMOVED BY ADMIN
* Created : Saturday, Oct 05, 2002
* Last Updated : Saturday, Oct 05, 2002
*
* Version : Spyder Manage - 0.9.0 BETA
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$sql = "SELECT count(t.topic_id) as total_spider_topics
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE f.forum_id = t.forum_id
AND f.auth_view <= " . AUTH_REG;
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query count info', '', __LINE__, __FILE__, $sql);
}
if ($countrow = $db->sql_fetchrow($result))
{
$total_spider_topics = $countrow['total_spider_topics'];
}
if( isset($HTTP_GET_VARS['offset']) || isset($HTTP_POST_VARS['offset']) )
{
$offset = ( isset($HTTP_POST_VARS['offset']) ) ? intval($HTTP_POST_VARS['offset']) : intval($HTTP_GET_VARS['offset']);
}
else
{
$offset = 0;
}
$sql = "SELECT c.cat_id, c.cat_title, f.forum_id, f.forum_name, f.forum_desc, f.auth_view, t.topic_id, t.topic_title, t.topic_last_post_id, t.topic_replies, p.bbcode_uid, p.post_text
FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . POSTS_TEXT_TABLE . " p
WHERE c.cat_id = f.cat_id
AND f.forum_id = t.forum_id
AND p.post_id = t.topic_first_post_id
AND f.auth_view <= " . AUTH_REG . "
ORDER BY t.topic_last_post_id DESC
LIMIT $offset, 100";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query topic info', '', __LINE__, __FILE__, $sql);
}
$template->set_filenames(array(
'body' => 'spyder_manage_body.tpl')
);
while( $topicrow = $db->sql_fetchrow($result))
{
$bbcode_uid = $topicrow['bbcode_uid'];
$cat_url = 'index.php?' . POST_CAT_URL . '=' . $topicrow['cat_id'];
$cat_title = $topicrow['cat_title'];
$forum_url = 'viewforum.php?' . POST_FORUM_URL . '=' . $topicrow['forum_id'];
$forum_name = $topicrow['forum_name'];
$topic_url = 'viewtopic.' . $phpEx . '?' . POST_TOPIC_URL . '=' . $topicrow['topic_id'];
$topic_title = $topicrow['topic_title'];
$last_post = 'viewtopic.' . $phpEx . '?' . POST_POST_URL . '=' . $topicrow['topic_last_post_id'] . '#' . $topicrow['topic_last_post_id'];
$topic_replies = $topicrow['topic_replies'];
$post_url = '';
$post_text = '';
if ( $topicrow['auth_view'] == 0 )
{
$post_text = $topicrow['post_text'];
$post_text = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $post_text);
$post_text = bbencode_second_pass($post_text, $bbcode_uid);
$post_text = make_clickable($post_text);
}
$template->assign_block_vars( 'topic_row', array(
'CAT_URL' => $cat_url,
'CAT_TILE' => $cat_title,
'FORUM_URL' => $forum_url,
'FORUM_NAME' => $forum_name,
'TOPIC_URL' => $topic_url,
'TOPIC_TITLE' => $topic_title,
'TOPIC_REPLIES' => $topic_replies,
'LAST_POST' => $last_post,
'POST_TEXT' => $post_text
)
);
}
$offset = $offset + 100;
if ( ($total_spider_topics - $offset) > 0 )
{
$next_url = $_SCRIPT_NAME . '?offset=' . $offset;
$template->assign_block_vars( 'switch_more', array ());
}
$template->assign_vars( array (
'L_CAT' => $lang['Category'],
'L_FORUM' => $lang['Forum'],
'L_TOPIC' => $lang['Topic'],
'L_LASTPOST' => $lang['Last_Post'],
'L_NEXT' => $lang['Next'],
'L_REPLIES' => $lang['Replies'],
'NEXT_URL' => $next_url
)
);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
<?php
/***************************************************************************
* spyder_manage.php
* -------------------
* Author : netclectic - Adrian Cockburn - EMAIL REMOVED BY ADMIN, Craven de Kere ( www.able2know.com)
* Created : Saturday, Oct 05, 2002
* Last Updated : June, 2003
*
* Version : A2K Spyder Manage - 1.0.0 BETA
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = 'forums/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
$page_title = $lang['At a Glance'];
include($phpbb_root_path . 'includes/page_header2.'.$phpEx);
$sql = "SELECT count(t.topic_id) as total_spider_topics
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE f.forum_id = t.forum_id
AND f.auth_view <= " . AUTH_REG;
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query count info', '', __LINE__, __FILE__, $sql);
}
if ($countrow = $db->sql_fetchrow($result))
{
$total_spider_topics = $countrow['total_spider_topics'];
}
if( isset($HTTP_GET_VARS['offset']) || isset($HTTP_POST_VARS['offset']) )
{
$offset = ( isset($HTTP_POST_VARS['offset']) ) ? intval($HTTP_POST_VARS['offset']) : intval($HTTP_GET_VARS['offset']);
}
else
{
$offset = 0;
}
$sql = "SELECT c.cat_id, c.cat_title, f.forum_id, f.forum_name, f.forum_desc, f.auth_view, t.topic_id, t.topic_title, t.topic_last_post_id, t.topic_replies, p.bbcode_uid, p.post_text
FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . POSTS_TEXT_TABLE . " p
WHERE c.cat_id = f.cat_id
AND f.forum_id = t.forum_id
AND p.post_id = t.topic_first_post_id
AND f.auth_view <= " . AUTH_REG . "
ORDER BY t.topic_last_post_id DESC
LIMIT $offset, 100";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query topic info', '', __LINE__, __FILE__, $sql);
}
$template->set_filenames(array(
'body' => 'spyder_manage_body2.tpl')
);
while( $topicrow = $db->sql_fetchrow($result))
{
$bbcode_uid = $topicrow['bbcode_uid'];
$cat_url = 'forums/index.php?' . POST_CAT_URL . '=' . $topicrow['cat_id'];
$cat_title = $topicrow['cat_title'];
$forum_url = 'forums/viewforum.php?' . POST_FORUM_URL . '=' . $topicrow['forum_id'];
$forum_name = $topicrow['forum_name'];
$topic_url = 'forums/viewtopic.' . $phpEx . '?' . POST_TOPIC_URL . '=' . $topicrow['topic_id'];
$topic_title = $topicrow['topic_title'];
$last_post = 'forums/viewtopic.' . $phpEx . '?' . POST_POST_URL . '=' . $topicrow['topic_last_post_id'] . '#' . $topicrow['topic_last_post_id'];
$topic_replies = $topicrow['topic_replies'];
$post_url = '';
$post_text = '';
if ( $topicrow['auth_view'] == 0 )
{
$post_text = $topicrow['post_text'];
$post_text = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $post_text);
$post_text = bbencode_second_pass($post_text, $bbcode_uid);
$post_text = make_clickable($post_text);
}
$template->assign_block_vars( 'topic_row', array(
'CAT_URL' => $cat_url,
'CAT_TILE' => $cat_title,
'FORUM_URL' => $forum_url,
'FORUM_NAME' => $forum_name,
'TOPIC_URL' => $topic_url,
'TOPIC_TITLE' => $topic_title,
'TOPIC_REPLIES' => $topic_replies,
'LAST_POST' => $last_post,
'POST_TEXT' => $post_text
)
);
}
$offset = $offset + 100;
if ( ($total_spider_topics - $offset) > 0 )
{
$next_url = $_SCRIPT_NAME . '?offset=' . $offset;
$template->assign_block_vars( 'switch_more', array ());
}
$template->assign_vars( array (
'L_CAT' => $lang['Category'],
'L_FORUM' => $lang['Forum'],
'L_TOPIC' => $lang['Topic'],
'L_LASTPOST' => $lang['Last_Post'],
'L_NEXT' => $lang['Next'],
'L_REPLIES' => $lang['Replies'],
'NEXT_URL' => $next_url
)
);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail2.'.$phpEx);
?>
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr><th class="thTop">All the forums at a glance</th>
</tr>
<tr><td class="cat"></td>
</tr>
<tr><td class="row1" align="center"><span class="genmed"><a href="http://www.able2know.com/forums/search.php?search_id=newposts">New Post Search</a></span><br />
<span class="genmed"><a href="http://www.able2know.com/forums/search.php?search_id=egosearch">Your Posts</a></span><br />
<span class="genmed"><a href="http://www.able2know.com/allthetopics.php">New Topics</a></span><br />
</tr>
<tr>
<td class="row2"></td>
</tr>
<tr><td class="row3"></td></tr>
</table>
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr><td><a href="{U_INDEX}" class="nav">{L_INDEX}</a></td></tr>
</table>
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<!-- BEGIN switch_more -->
<tr><td colspan="3" class="row3" align="right"><a href="{NEXT_URL}" class="gen">Next Page</a></td></tr>
<!-- END switch_more -->
<tr><th class="thTop" width="20%" >{L_FORUM}</th>
<th class="thTop" width="35%">{L_TOPIC}</th>
<th class="thTop" width="20%"></th>
</tr>
<!-- BEGIN topic_row -->
<tr><td class="row1" width="20%" ><a href="{topic_row.FORUM_URL}" class="cattitle">{topic_row.FORUM_NAME}</a></td>
<td class="row1" ><a href="{topic_row.TOPIC_URL}" class="cattitle">{topic_row.TOPIC_TITLE}</a></td>
<td class="row1" width="20%" ><span class="gen"><a href="{topic_row.LAST_POST}" class="gen">{L_LASTPOST}</a>
({topic_row.TOPIC_REPLIES})</span></td>
</tr>
<!-- END topic_row -->
<!-- BEGIN switch_more -->
<tr><td colspan="3" class="row3" align="right"><a href="{NEXT_URL}" class="gen">Next Page</a></td></tr>
<!-- END switch_more -->
</table>
first and foremost, once again, THANK YOU THANK YOU THANK YOU! Your help has been most truly appreciated - and i think it's amazing you're not holding your code close to the vest, saying it's some sort of proprietary this or that and keeping it secret - you're like a human GNU license! (or make that hamster)...
Here's a question for you based on your response to my using a redirect:
my html.index pretty much has header tags, some robot stuff which gets ignored, and then a redirect to my gadgetaddict/forums/index.php - i
know you said redirects were a google no-no - is there a way i can install your mods above so google will go to them directly, or can i do something to avoid the redirect at least for google?
i was wondering if there was a way to cut and paste or do something with a sessions.php subset, so that upon going to index.html, google gets recognized and directed to the at-a-glance equivalenent - what do you think?
google did find my site (ONCE) and did make it to index.php (i believe) at which point it did not spider, and did not come back. I did register with dmoz a couple of months ago, but i'm wondering if i should also register with the subdirectories.
I've also been largely considering scrapping the site and starting over (last last last choice) in case i am very google-unfriendly. which i don't want to be. i want to be a google friend. i want google to sleep over nights and weekends.
my index.html file is this:
<html>
<head>
<TITLE>Gadget Addict! Home of Gizmo, the original Gadget Addict!</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Description" CONTENT="A gadgeteer's dream! Gadgets, gizmos and more - reviews, news, toys, hobbies, recreation games computers pdas - we review anything interesting! FREE">
<META NAME="Keywords" CONTENT="gadgetaddict, Gadget Addict, Gadgets, Gizmo, Gizmos, Gadgeteer, electronics, reviews, news, free, forums, community, recreation, friendly, electronic, pockt pc, palm, pda, pocktpc">
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
<META NAME="REVISIT-AFTER" CONTENT="1 DAYS">
<!-- META Tags Created by: ABS' META Tag Builder http://www.scrubtheweb.com/abs/ -->
</head>
<body bgcolor="#FFFFFF" text="#000000">
<script language="javascript">
<!--
document.location.href="forums/portal.php"
//-->
</script>
</body>
</html>
what i'd love to do is put in a check if it's google - and if it is then run the spidering code - is that easily accomplished?