Page 22 of 24

Posted: Thu Mar 01, 2007 1:52 am
by mgutt
Its a bug in the reputation mod. this line:

Code: Select all

$reputation .=  " <a href=\""  . append_sid("reputation.$phpEx?a=add&" . POST_USERS_URL . "=" . $postrow[$i]['user_id']) . "&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&c=" . substr(md5($bbcode_uid),0,8) . "\" target=\"_blank\" onClick=\"popupWin = window.open(this.href, '" . $lang['Reputation'] . "', 'location,width=700,height=400,top=0,scrollbars=yes'); popupWin.focus(); return false;\"><img src=\"images/reputation_add_plus.gif\" alt=\"\" border=\"0\"><img src=\"images/reputation_add_minus.gif\" alt=\"\" border=\"0\"></a>";
must be written as follows:

Code: Select all

$reputation .=  " <a href=\""  . append_sid("reputation.$phpEx?a=add&" . POST_USERS_URL . "=" . $postrow[$i]['user_id'] . "&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&c=" . substr(md5($bbcode_uid),0,8)) . "\" target=\"_blank\" onClick=\"popupWin = window.open(this.href, '" . $lang['Reputation'] . "', 'location,width=700,height=400,top=0,scrollbars=yes'); popupWin.focus(); return false;\"><img src=\"images/reputation_add_plus.gif\" alt=\"\" border=\"0\"><img src=\"images/reputation_add_minus.gif\" alt=\"\" border=\"0\"></a>";

Posted: Thu Mar 01, 2007 4:51 pm
by Solinarius
thanks for so quick answer!

.htaccess

Posted: Wed Mar 07, 2007 1:04 am
by dosser
Big thanks for all your work on this mgutt - superb mod.

All the links are now properly formatted - the only thing is my homepage now will not load. I think this is due to some problem with the root .htaccess file as I have had to add a couple of lines of my own cos my server otherwise doesn't do php5 which i need.

The homepage should be home.php4 and when i type it in long hand (/home.php4) it loads fine, but otherwise I get a 403 forbidden error. And by the way it was working fine before I added the mod. My forum is in /forum/ etc

Code: Select all

AddType x-mapp-php5 .php


<Files config.php> 
Deny from all 
</Files> 

DirectoryIndex index.php index.html index.htm

RewriteEngine On

# SEO URL [mgutt]
RewriteRule !\.html$ - [L]
RewriteRule ^forum/[a-z0-9-]+-([pt])([0-9]+)\.html$ /forum/viewtopic.php?$1=$2 [L]
RewriteRule ^forum/[a-z0-9-]+-f([0-9]+)\.html$ /forum/viewforum.php?f=$1 [L]
RewriteRule ^forum/[a-z0-9-]+-c([0-9]+)\.html$ /forum/index.php?c=$1 [L]
RewriteRule ^forum/[a-z0-9-]+-u([0-9]+)\.html$ /forum/profile.php?mode=viewprofile&u=$1 [L]
RewriteRule ^forum/([a-zA-Z0-9_]+),([^/,]+),([^/,]*)([^/]*\.html)$ forum/$1$4?$2=$3 [QSA,N]
RewriteRule ^forum/[a-z0-9-]+-([pt])([0-9]+),([^/,]+),([^/,]*)([^/]*\.html)$ forum/viewtopic$5?$1=$2&$3=$4 [QSA,N]
RewriteRule ^forum/[a-z0-9-]+-f([0-9]+),([^/,]+),([^/,]*)([^/]*\.html)$ forum/viewforum$4?f=$1&$2=$3 [QSA,N]
RewriteRule ^forum/([a-zA-Z0-9_]+)\.html$ /forum/$1.php [L]

Any idea what is going? Thanks very much in advance.

Posted: Sat Mar 10, 2007 3:08 pm
by mgutt
You directory index is home.php4?

try to change the index and add your file:

Code: Select all

DirectoryIndex home.php4 index.php index.html index.htm 
And change it in your sessions.php if it is called in the forum pages as well.

regards

Re: [BETA] SEO Urls V2

Posted: Thu Mar 29, 2007 8:28 am
by cissss
SOS!!!

i just install the MOD,but when i go to my sit it says:

Parse error: syntax error, unexpected ',' in /home/mysite/public_html/includes/sessions.php on line 734

i'm not a PHP pro,so i don't know what happened

here is my sessions.php

http://www.wwefish.com/sessions.txt


plz,help me~

Re: [BETA] SEO Urls V2

Posted: Sat Mar 31, 2007 5:57 pm
by dosser
Thanks for the tip mgutt worked great and now all the urls and homepage are working great.

The only problem - I have an external login/logout for the forum in the root directory of my site (the forum being http://www.mysite.com/forum/). As such it uses a redirect to return to eg the homepage having logged in/logged out. The login still works fine, and redirects to the correct url but the logout returns a url such as eg http://www.mysite.com/home4id,0.html instead of http://www.mysite.com/home4.php.

What I want to know is can I put an exception in my .htaccess file so that the seo-url mod ignores all login.php urls and if so would this even work (seems strange to me that the login section works fine but the logout does not even though both require the login.php script? I have tried the following without success both before and after the final RewriteRule -

Code: Select all

RewriteRule ^forum/login\.php$ /forum/login.php?logout=true&sid=$1&redirect=$2&outside=1 [L]


Is there some way of adding an exception and if so where should it be placed in the .htaccess file? At the end of the RewriteRules or somewhere in the middle?

Many thanks.

CD

Re: [BETA] SEO Urls V2

Posted: Sun Apr 01, 2007 1:00 pm
by saxena
You need the apache modul "mod_rewrite" to use this mod.


Will this work on other PHP based applications 8)

Re: [BETA] SEO Urls V2

Posted: Wed Apr 04, 2007 4:55 pm
by Top_Speed
Thanks mg
Works great!

One thing- I have a mod that write the top xx rated posts to my index page and the urls are not quite right. They all show the last post in the last forum/thread as their url but all do have the correct thread # on the tail of the url.

This is a possible "seo duplicate spam issue" with the SE's. Any ideas on how the "top 10 taed posts" can have their URL correct?

Many Thanks,
Speed

Re: [BETA] SEO Urls V2

Posted: Sat Apr 14, 2007 6:39 am
by amin_ch
Hello

Where I can find file constants.php ?
I don't see this file in root directory.
Thanks.

Amin Ch.

Re: [BETA] SEO Urls V2

Posted: Sat Apr 14, 2007 8:51 am
by gansert
amin_ch wrote: Hello

Where I can find file constants.php ?
I don't see this file in root directory.
Thanks.

Amin Ch.


Have a look in FOLDER

Code: Select all

/includes

Code: Select all

root/includes/constants.php

Re: [BETA] SEO Urls V2

Posted: Sat Apr 14, 2007 12:17 pm
by mgutt


Use an other html editor and reinstall the mod.
dosser wrote: The login still works fine, and redirects to the correct url but the logout returns a url such as eg http://www.mysite.com/home4id,0.html instead of http://www.mysite.com/home4.php.


Add "home4.php?id" to your forbidden files in sessions.php.
saxena wrote:
You need the apache modul "mod_rewrite" to use this mod.


Will this work on other PHP based applications 8)


Sorry, I did not understand your question. Try to install the mod or upload the .htaccess only. If your site loads without any errors it could be possible to install my mod.
Top_Speed wrote: One thing- I have a mod that write the top xx rated posts to my index page and the urls are not quite right.


Please give us an example of the "wrong" url. Paste your code where the xx rated posts are read and displayed with.

Re: [BETA] SEO Urls V2

Posted: Mon Apr 16, 2007 1:49 pm
by Top_Speed
Thanks for the response mg...

indexbody.tpl line...

Code: Select all

<TD>{RATING_INDEX}</TD>
Here is the rating_index_body.tpl

Code: Select all

<table width="100%" cellpadding="0" cellspacing="0" border="0" class="forumline">
	
	<!-- BEGIN notopics -->
		<td class="row3" align="left" valign="top"><span class="gensmall">&nbsp;{notopics.MESSAGE}</span></td>
	<!-- END notopics -->
	<!-- BEGIN ratingrow -->
	<tr>
		<td class="row3" align="right" valign="top"><span class="gensmall">{ratingrow.RATING} :&nbsp;</td><td class="row3" width="87%" align="left" valign="top"> <a href="{ratingrow.URL}">{ratingrow.TITLE}</a></span></td>
	</tr>
	<!-- END ratingrow -->
</table>
And here is the rating.php itself...

Code: Select all

<?php
/***************************************************************************
*                            $RCSfile: rate.php,v $
*                            -------------------
*   begin                : Saturday, May 08, 2003
*   copyright            : (C) 2002-2003 Nivisec.com
*   email                : support@nivisec.com
*
*   $Id: rate.php,v 2.4 2003/05/21 18:49:27 nivisec Exp $
*
*
***************************************************************************/

/***************************************************************************
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/

define('IN_PHPBB', TRUE);
$phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

/*******************************************************************************************
/** Start session.
/******************************************************************************************/
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

/*******************************************************************************************
/** Get parameters.
/******************************************************************************************/
$params = array('rate_mode', 'forum_top', 'topic_id', 'rating');

foreach($params as $var)
{
	$$var = '';
	if( isset($HTTP_POST_VARS[$var]) || isset($HTTP_GET_VARS[$var]) )
	{
		$$var = ( isset($HTTP_POST_VARS[$var]) ) ? $HTTP_POST_VARS[$var] : $HTTP_GET_VARS[$var];
	}
}
/*******************************************************************************************
/** Page Titles if Specific!
/******************************************************************************************/
switch($rate_mode)
{
	case 'rate':
			$page_title = $lang['Rating'];
	case 'rerate':
	break;
	case 'detailed':
	{
		if ($topic_id == '')
		{
			message_die(GENERAL_ERROR, $lang['No_Topic_ID'], '', __LINE__, __FILE__);
		}
		$page_title = $lang['Topic_Rating_Details'];
		break;
	}
	default:
	{
		if ($forum_top == '')
		{
			$forum_top = -1;
		}
		$page_title = sprintf($lang['Top_Topics'], $board_config['large_rating_return_limit']);
		break;
	}
}
/*******************************************************************************************
/** Include Header (It Contains Rate Functions).
/******************************************************************************************/
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

/*******************************************************************************************
/** Display modes, for if the page is called seperately
/******************************************************************************************/
switch($rate_mode)
{
	case 'rate':
			rate_topic($userdata['user_id'], $topic_id, $rating, 'rate');
			break;
	case 'rerate':
				rate_topic($userdata['user_id'], $topic_id, $rating, 'rerate');
	break;
	case 'detailed':
	{
		ratings_detailed($topic_id);
		break;
	}
	default:
	{
		ratings_large();
		break;
	}
}
nivisec_copyright();
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
Many thanks for looking at this!!
~Speed

Re: [BETA] SEO Urls V2

Posted: Fri Apr 27, 2007 12:23 am
by dosser
Thanks mcgutt worked a charm!

CD

Re: [BETA] SEO Urls V2

Posted: Fri May 04, 2007 5:22 pm
by mgutt
@ top speed

post the file where template var "URL" is defined.

regards

Re: [BETA] SEO Urls V2

Posted: Fri May 04, 2007 9:32 pm
by Adavis
I have a phpBB in greek. Can I use this mod?