MOD Thanks for post by Палыч works now

phpBB3 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting forums and topic titles in their URLs.

Moderator: Moderators


MOD Thanks for post by Палыч works now

Postby IPB_Refugee » Thu Jul 09, 2009 1:08 pm

Hello,

I want to install Палыч's Thank Post MOD because it needs much less SQL queries than e.g. Mahoney's Thanks MOD:

[RC] Thanks for post by Палыч

The problem is that it doesn't work together with your SEO MODs out of the box. I have already added 'thanks=' and 'rthanks=' to the stop vars in phpbb_seo_class.php:

Code: Select all
      // Stop vars
      $this->seo_stop_vars = array('view=', 'mark=', 'watch=', 'hash=', 'thanks=', 'rthanks=');


So I get URLs like

example.com/viewtopic.php?p=13973&thanks=13973&to_id=18

So far, so good. The problem starts here in viewtopic.php, just before // Output the posts:

Code: Select all
// Thank MOD
include($phpbb_root_path . 'includes/functions_thanks.' . $phpEx);
array_all_thanks();

if (isset($_REQUEST['thanks']) && !isset($_REQUEST['rthanks']))
{
   insert_thanks(request_var('thanks', 0), $user->data['user_id']);
}
if (isset($_REQUEST['rthanks']) && !isset($_REQUEST['thanks']))
{
   delete_thanks(request_var('rthanks', 0), $user->data['user_id']);
}

// Output the posts


array_all_thanks() gets called correctly, but there are no $_REQUEST['thanks'] / $_REQUEST['rthanks'] because of the rewritten URLs.

I have Advanced SEO URL MOD and every extension like No Dupe and Zero Dupe and my board is still on 3.0.4. (I know I should update...)

What is the best way to solve this incompatibility problem?

Greetings from Austria!
Wolfgang

EDIT: What is the better way in your opinion? Altering the .htaccess (so that variables like 'thanks' and 'rthanks' can get passed) or creating an independent file like thanks.php which does the work when someone thanks a post or revokes his/her thanking?
Last edited by IPB_Refugee on Thu Feb 04, 2010 11:37 am, edited 1 time in total.
User avatar
IPB_Refugee
PR0
PR0
 
Posts: 81
Joined: Thu Jul 24, 2008 2:18 pm

Advertisement

Re: MOD Thanks for post by Палыч doesn't work

Postby dcz » Sat Jul 11, 2009 12:57 pm

It looks like a zero dupe matter, because GET variable are not altered by our mod.

Is the url viewtopic.php?p=13973&thanks=13973&to_id=18 redirected ?

You may just need to add thanks and to_id in viewtopic.php's zero dupe definitions.
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 19930
Joined: Fri Apr 28, 2006 9:03 pm

Re: MOD Thanks for post by Палыч doesn't work

Postby Autinhyeu » Mon Jul 13, 2009 5:12 pm

dcz wrote:It looks like a zero dupe matter, because GET variable are not altered by our mod.

Is the url viewtopic.php?p=13973&thanks=13973&to_id=18 redirected ?

You may just need to add thanks and to_id in viewtopic.php's zero dupe definitions.

How to do it? :)
Thanks!
Autinhyeu
PR0
PR0
 
Posts: 79
Joined: Sat Aug 09, 2008 8:33 am

Re: MOD Thanks for post by Палыч doesn't work

Postby IPB_Refugee » Tue Jul 14, 2009 3:33 pm

Ah, I remember... Thank you, dcz!

@Autinhyeu:

I don't have the time to work on this at the moment (hopefully I will find some time at weekend), but the integration of primehalo's Post Revision MOD into the Zero Dupe part of viewtopic.php might give you an idea:

Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN -> Zero dupe
$phpbb_seo->seo_opt['zero_dupe']['start'] = $phpbb_seo->seo_chk_start( $start, $config['posts_per_page'] );

   // Changings for primehalo's Post Revision MOD
   $displ_history = request_var('display_history', false);
   $rem_history = request_var('remove_history', '');
   $conf_key = request_var('confirm_key', '');
   
if ( $post_id && !$phpbb_seo->set_do_redir_post()) {
   $phpbb_seo->seo_opt['zero_dupe']['redir_def'] = array(
      'p' => array('val' => $post_id, 'keep' => true, 'force' => true),
      'hilit' => array('val' => (($highlight_match) ? $highlight : ''), 'keep' => !empty($highlight)),
      
      // Changings for primehalo's Post Revision MOD
      'display_history' => array('val' => $displ_history, 'keep' => (boolean) ($displ_history == true)),
      'remove_history' => array('val' => $rem_history, 'keep' => $rem_history),
      'confirm_key' => array('val' => $conf_key, 'keep' => $conf_key),
   );
} else {
   $seo_watch = request_var('watch', '');
   $seo_unwatch = request_var('unwatch', '');
   $seo_bookmark = request_var('bookmark', 0);
   $keep_watch = (boolean) ($seo_watch == 'topic' && $user->data['is_registered']);
   $keep_unwatch = (boolean) ($seo_unwatch == 'topic' && $user->data['is_registered']);
   $keep_hash = (boolean) ($keep_watch || $keep_unwatch || $seo_bookmark);
   $phpbb_seo->seo_opt['zero_dupe']['redir_def'] = array(
      'uid' => array('val' => request_var('uid', 0), 'keep' => $keep_hash),
      'f' => array('val' => $forum_id, 'keep' => true, 'force' => true),
      't' => array('val' => $topic_id, 'keep' => true, 'force' => true),

      // Changings for primehalo's Post Revision MOD
      //'p' => array('val' => $post_id, 'keep' =>  ($view == 'show' ? true : false)),
      'p' => array('val' => $post_id, 'keep' =>  (($view == 'show' || $displ_history || !empty($rem_history) || !empty($conf_key)) ? true : false)),
      'display_history' => array('val' => $displ_history, 'keep' => (boolean) ($displ_history == true)),
      'remove_history' => array('val' => $rem_history, 'keep' => $rem_history),
      'confirm_key' => array('val' => $conf_key, 'keep' => $conf_key),

      'watch' => array('val' => $seo_watch, 'keep' => $keep_watch),
      'unwatch' => array('val' => $seo_unwatch, 'keep' => $keep_unwatch),
      'bookmark' => array('val' => $seo_bookmark, 'keep' => (boolean) ($user->data['is_registered'] && $config['allow_bookmarks'] && $seo_bookmark)),
      'start' => array('val' => $phpbb_seo->seo_opt['zero_dupe']['start'], 'keep' => true, 'force' => true),
      'hash' => array('val' => request_var('hash', ''), 'keep' => $keep_hash),
      'st' => array('val' => $sort_days, 'keep' => true),
      'sk' => array('val' => $sort_key, 'keep' => true),
      'sd' => array('val' => $sort_dir, 'keep' => true),
      'view' => array('val' => $view, 'keep' => $view == 'print' ? (boolean) $auth->acl_get('f_print', $forum_id) : ($view == 'viewpoll' ? true : false)),
      'hilit' => array('val' => (($highlight_match) ? $highlight : ''), 'keep' => (boolean) !(!$user->data['is_registered'] && $phpbb_seo->seo_opt['rem_hilit'])),
   );
}
$phpbb_seo->seo_chk_dupe();
// www.phpBB-SEO.com SEO TOOLKIT END -> Zero dupe


If you (or someone else) finds a working solution before me, just feel free to post it. :wink:

Regards
Wolfgang

You may just need to add thanks and to_id in viewtopic.php's zero dupe definitions.


And rthanks, as far as I remember from the Thank Post MOD.
User avatar
IPB_Refugee
PR0
PR0
 
Posts: 81
Joined: Thu Jul 24, 2008 2:18 pm

Re: MOD Thanks for post by Палыч doesn't work

Postby Autinhyeu » Tue Jul 14, 2009 4:16 pm

Okie ;)
Thanks you, i'll try do it...
please reply at here if you do it successful before me :D
Autinhyeu
PR0
PR0
 
Posts: 79
Joined: Sat Aug 09, 2008 8:33 am

Re: MOD Thanks for post by Палыч doesn't work

Postby Autinhyeu » Tue Jul 14, 2009 5:38 pm

OK. i had do it, and function 'thanks' had work great :)
but function 'remove thanks' still not working :(
anybody can help me??? :oops:
Best regards!
Autinhyeu
Autinhyeu
PR0
PR0
 
Posts: 79
Joined: Sat Aug 09, 2008 8:33 am

Re: MOD Thanks for post by Палыч doesn't work

Postby IPB_Refugee » Thu Jul 16, 2009 1:26 am

Hi Autinhyeu,

can you post your solution so far, please?

Furthermore we need the exact URL when you try to remove a thanks.

Isn't it something like:

example.com/viewtopic.php?p=13973&rthanks=13973&to_id=18

I'm sorry that I can't help more but I'm despairing of a different project at the moment... :(

But I'm quite sure that we'll get this problem solved and that ultimately there will be a fine Thank Post MOD for Olympus (which will not need about two additional queries per post like the other Thank Post MOD requires).

Regards
Wolfgang
User avatar
IPB_Refugee
PR0
PR0
 
Posts: 81
Joined: Thu Jul 24, 2008 2:18 pm

Re: MOD Thanks for post by Палыч doesn't work

Postby Autinhyeu » Thu Jul 16, 2009 2:35 am

Open viewtopic.php
find:
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN -> Zero dupe
$phpbb_seo->seo_opt['zero_dupe']['start'] = $phpbb_seo->seo_chk_start( $start, $config['posts_per_page'] );

add after:
Code: Select all
   // Thanks mod
   $to_id = request_var('to_id', 0);
   $thanks = request_var('thanks', 0);

find:
Code: Select all
      'p' => array('val' => $post_id, 'keep' => true, 'force' => true, 'hash' => "p$post_id"),
      'hilit' => array('val' => (($highlight_match) ? $highlight : ''), 'keep' => !empty($highlight_match)),

add after:
Code: Select all
      // Thanks mod
      'to_id' => array('val' => $to_id, 'keep' => $to_id),
      'thanks' => array('val' => $thanks, 'keep' => $thanks),

find:
Code: Select all
      'uid' => array('val' => $seo_uid, 'keep' => (boolean) ($keep_hash && $seo_uid)),
      'f' => array('val' => $forum_id, 'keep' => true, 'force' => true),
      't' => array('val' => $topic_id, 'keep' => true, 'force' => true, 'hash' => $post_id ? "p$post_id" : ''),

add after:
Code: Select all
      // Thanks mod
      'to_id' => array('val' => $to_id, 'keep' => $to_id),
      'thanks' => array('val' => $thanks, 'keep' => $thanks),


& function thank will work good :)

------------

with function remove thank, i had try do the same, but don't successful. because when remove thank, you need confirm "Are you sure you want to remove your thanks?" in the page remove thank. when i click "yes", no what happens :oops: , page no load & no redirect :roll:
Autinhyeu
PR0
PR0
 
Posts: 79
Joined: Sat Aug 09, 2008 8:33 am

Re: MOD Thanks for post by Палыч doesn't work

Postby dcz » Fri Jul 17, 2009 8:26 am

As IPB_Refugee said, we need to know what is the url to remove a thank :
IPB_Refugee wrote:Furthermore we need the exact URL when you try to remove a thanks.

Isn't it something like:

example.com/viewtopic.php?p=13973&rthanks=13973&to_id=18
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 19930
Joined: Fri Apr 28, 2006 9:03 pm

Re: MOD Thanks for post by Палыч doesn't work

Postby Autinhyeu » Fri Jul 17, 2009 2:39 pm

yes, i know. please read:
because when remove thank, you need confirm "Are you sure you want to remove your thanks?" in the page remove thank. when i click "yes", no what happens :oops: , page no load & no redirect :roll:
Autinhyeu
PR0
PR0
 
Posts: 79
Joined: Sat Aug 09, 2008 8:33 am

Re: MOD Thanks for post by Палыч doesn't work

Postby dcz » Sat Jul 18, 2009 9:28 am

But what does the url you click on to remove a thanks looks like (before you click on it, on FF, right click save link) ?
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 19930
Joined: Fri Apr 28, 2006 9:03 pm

Re: MOD Thanks for post by Палыч doesn't work

Postby Autinhyeu » Sat Jul 18, 2009 2:08 pm

after i click remove thanks, the page confirm show with "yes" and "no", after i click "yes", no what happens. i need help :)
Autinhyeu
PR0
PR0
 
Posts: 79
Joined: Sat Aug 09, 2008 8:33 am

Re: MOD Thanks for post by Палыч doesn't work

Postby dcz » Sat Jul 25, 2009 9:04 am

On that link you click, what is the url (before you click) ?
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 19930
Joined: Fri Apr 28, 2006 9:03 pm

Re: MOD Thanks for post by Палыч doesn't work

Postby Autinhyeu » Sun Jul 26, 2009 7:40 am

it's:
Code: Select all
http://www.autinhyeu.com/forum/post17176.html?rthanks=17176&to_id=2470

after click:
Code: Select all
http://www.autinhyeu.com/forum/pc-tips/cac-thu-thuat-tim-kiem-hieu-qua-voi-bing-t5791.html?to_id=2470&rthanks=17176#p17176

if i remove confirm form, it will work :)
but confirm form is security of phpBB, i don't want remove it...
Autinhyeu
PR0
PR0
 
Posts: 79
Joined: Sat Aug 09, 2008 8:33 am

Re: MOD Thanks for post by Палыч doesn't work

Postby dcz » Mon Jul 27, 2009 10:34 am

Ok, so I think that thanks are post based, but that the zero dupe is here redirecting the post urls to topic one, so try this, based on the code posted here : MOD Thanks for post by Палыч doesn't work
Find :
Code: Select all
// www.phpBB-SEO.com SEO TOOLKIT BEGIN -> Zero dupe
$phpbb_seo->seo_opt['zero_dupe']['start'] = $phpbb_seo->seo_chk_start( $start, $config['posts_per_page'] );

After add :
Code: Select all
// Thanks mod
$to_id = request_var('to_id', 0);
$thanks = request_var('thanks', 0);
$rthanks = request_var('rthanks', 0);

Find :
Code: Select all
if ( $post_id && !$view && !$phpbb_seo->set_do_redir_post()) {

Replace with :
Code: Select all
if ( ($rthanks || $thanks) || ($post_id && !$view && !$phpbb_seo->set_do_redir_post())) {

Find :
Code: Select all
   $phpbb_seo->seo_opt['zero_dupe']['redir_def'] = array(
      'p' => array('val' => $post_id, 'keep' => true, 'force' => true, 'hash' => "p$post_id"),
      'hilit' => array('val' => (($highlight_match) ? $highlight : ''), 'keep' => !empty($highlight_match)),

After add :
Code: Select all
      // Thanks mod
      'rthanks' => array('val' => $rthanks, 'keep' => $rthanks),
      'to_id' => array('val' => $to_id, 'keep' => $to_id),
      'thanks' => array('val' => $thanks, 'keep' => $thanks),

Should work ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 19930
Joined: Fri Apr 28, 2006 9:03 pm

Next

Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 45 guests


 
cron