[MODDB] Quote Post Back Link

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Get Involved
Locked
lugsciath
Registered User
Posts: 316
Joined: Tue Oct 02, 2007 11:12 am

Re: [RC2] Quote Post Back Link

Post by lugsciath » Wed Apr 08, 2009 10:32 pm

Jup, that may be. How could i made that "include" ?

Is it really simple like e.g. "include($phpbb_root_path . 'language/de/bbcode.' . $phpEx);" ?

I post my rss.php:

Code: Select all

<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2008 Manchumahara(Sabuj Kundu)
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/

define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'language/en/common.' . $phpEx);

// Start session
$user->session_begin();
$auth->acl($user->data);
$user->setup();


function make_xml_compatible($text,$bbcode_uid, $bbcode_bitfield,$bbcode_options)
{
	 global $config, $base_url;
	 $text = html_entity_decode(generate_text_for_display($text, $bbcode_uid, $bbcode_bitfield, $bbcode_options));
	 $text = nl2br($text);
// Eingefügt durchs Linkquoten das ;
         $text = str_replace('&pound', '&#163;', $text);
         $text = str_replace('&copy;', '(c)', $text);
         $text = htmlspecialchars($text);
	 return $text; 
}
//Get the board url address
$board_url = generate_board_url();

// Start RSS output
header('Content-type: application/rss+xml; charset=UTF-8');
$rss_result = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<rss version=\"2.0\"  xmlns:atom=\"http://www.w3.org/2005/Atom\">
<channel>
<atom:link href=\"".$board_url."/rss.$phpEx\" rel=\"self\" type=\"application/rss+xml\" /> 
  <title>".$config['sitename']."</title>
  <link>".$board_url."</link>
  <description>".$config['site_desc']."</description>
  <language>".$config['default_lang']."</language>
  <copyright>".$user->lang['RSS_COPYRIGHT']."  ".$config['sitename']."</copyright>     
  <managingEditor>".$config['board_email']." (".$config['sitename'].")</managingEditor>  
   <generator>".$config['sitename']."</generator>
  <ttl>1</ttl>  
";
        //
        // This SQL query selects the latest topics of all forum
        
        
        $sql = 'SELECT f.forum_id,f.forum_name, f.forum_desc_options, t.topic_title, t.topic_id,t.topic_last_post_id,t.topic_last_poster_name, p.post_time, p.post_text, 
        	p.bbcode_uid, p.bbcode_bitfield, u.username, u.user_id
                FROM  '. FORUMS_TABLE .'  f,'.TOPICS_TABLE.' t, '.POSTS_TABLE.' p,'.USERS_TABLE.' u
                WHERE t.forum_id = f.forum_id
                AND t.topic_status != 1
                AND p.post_id = t.topic_last_post_id 
                AND u.user_id = p.poster_id
                ORDER BY t.topic_last_post_id DESC';	
        if(!$result = $db->sql_query_limit($sql,30))
        {
        		trigger_error($user->lang['RSS_FAILURE']);               
        }
        while($row = $db->sql_fetchrow($result))
        {
        	   $forumid=$row['forum_id'];
        	   $topicid=$row['topic_id'];
               if($auth->acl_get('f_read',$forumid))	   //getting authentication
               {
               	   $post_link    = $board_url."/viewtopic.".$phpEx."?f=".$forumid."&t=".$topicid."#p".$row['topic_last_post_id'];
                   $topic_link   = $board_url."/viewtopic.".$phpEx."?f=".$forumid."&t=".$topicid;
                   $description  = $user->lang['POST_BY_AUTHOR']." ".$row['topic_last_poster_name']." (".$user->lang['POSTED']." ".$user->format_date($row['post_time']).")<br/>".$row['post_text']."<br /><br /><a href=\"".$topic_link."\">".$user->lang['RSS_READ_TOPIC']."</a><hr />";                          
		           $rss_result .= "
                                  <item>
                                  <title>".$row['topic_title']."</title>
                                  <link>".$post_link."</link>
                                  <description>".make_xml_compatible($description, $row['bbcode_uid'], $row['bbcode_bitfield'], $row['forum_desc_options'])."</description>
                                        					    <pubDate>".$user->format_date($row['post_time'])."</pubDate>                                        
                            	    <guid isPermaLink=\"true\">".$post_link."</guid>		   					
                                      </item>";
                }
        }


$rss_result .= '</channel></rss>';
echo $rss_result;
$db->sql_freeresult($result);
?>

naduvko
Registered User
Posts: 9
Joined: Sun Mar 29, 2009 2:34 pm

Re: [RC2] Quote Post Back Link

Post by naduvko » Thu Apr 09, 2009 6:24 am

Yes, it's simple like

Code: Select all

if (!defined('QPBL'))
{
    include ($phpbb_root_path . 'includes/mods/functions_qpbl.' . $phpEx);
}
 
I think...
Last edited by naduvko on Thu Apr 09, 2009 10:05 am, edited 1 time in total.

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: [RC2] Quote Post Back Link

Post by Erik Frèrejean » Thu Apr 09, 2009 9:59 am

That should do the trick if you paste it right after:

Code: Select all

include($phpbb_root_path . 'common.' . $phpEx); 
So it looks like:

Code: Select all

include($phpbb_root_path . 'common.' . $phpEx);
if (!defined('QPBL'))
{
   include ($phpbb_root_path . 'includes/mods/functions_qpbl.' . $phpEx);
} 
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

lugsciath
Registered User
Posts: 316
Joined: Tue Oct 02, 2007 11:12 am

Re: [RC2] Quote Post Back Link

Post by lugsciath » Tue Apr 14, 2009 9:44 pm

No, it doesnt works. Same Errorreport:

Code: Select all

<b>Fatal error</b>:  Call to a member function bbcode_tpl() on a non-object in <b>/mnt/web4/31/85/5712785/htdocs/clochsliaph/neuesforum/includes/mods/functions_qpbl.php</b> on line <b>280</b><br />
Each line which contains this:

Code: Select all

//  $quote = str_replace(array('$1', '$2', '$3'), array($username, $post_uri, $post_title), $bbcode->bbcode_tpl($bbcode_tpl_name)) . $quote;
(just coded out)

If you have posts without citatations everythings okay, but only one post with it (with backlink) , see above.

Greetings

Uwe

lugsciath
Registered User
Posts: 316
Joined: Tue Oct 02, 2007 11:12 am

Re: [RC2] Quote Post Back Link

Post by lugsciath » Wed Apr 15, 2009 6:25 am

Adding:

Seams it doesnt works with all combinations e.g.

Code: Select all

[quote]
,

Code: Select all

[quote="lugsciath"]
Whenever i tried to quoting, the call of linefeeder / rss.php produces this error. The line with including function_qpbl.php is insert in rss.php after the common.php.

Update:

After including bbcode.php too i get a double declaration error. Just i tried to comment in rss.php feeder the line with bbcodes out

f

Code: Select all

unction make_xml_compatible($text,$bbcode_uid, $bbcode_bitfield,$bbcode_options)
{
	 global $config, $base_url;
//	 $text = html_entity_decode(generate_text_for_display($text, $bbcode_uid, $bbcode_bitfield, $bbcode_options));
	 $text = nl2br($text);
// Eingefügt durchs Linkquoten das ;
         $text = str_replace('&pound', '&#163;', $text);
         $text = str_replace('&copy;', '(c)', $text);
         $text = htmlspecialchars($text);
	 return $text; 
}
Now it works (natural without showing any bbcode ;) ), but i think really the error might in that case produced in functions_qpbl.php, 2nd pass may be ?

After some time i looked at bbcode.php

Code: Select all

							'#\[quote(?:="(.*?)")?:$uid\]((?!\[quote(?:=".*?")?:$uid\]).)?#ise'	=> "\$this->bbcode_second_pass_quote('\$1', '\$2')"
							*/
                            '#\[quote(?:="(.*?)")?(;p="([0-9]+)")?:$uid\]((?!\[quote(?:=".*?")?:$uid\]).)?#ise' => [color=#FF0000]"\$this->[/color]qpbl_second_pass('\$4', '\$1', '\$3')"
Could cause the missing $this-> these errors ? (Please look at the example). I´ve tried it so

?#ise' => "\$this->qpbl_second_pass('\$4', '\$1', '\$3')"

(original) ?#ise' => "qpbl_second_pass('\$4', '\$1', '\$3')"



but i get a errormessage for missing method bbcode? It seams a construction Problem.

just waiting on a solution (i tried my very best)

Greetings

Uwe

franfj
Registered User
Posts: 5
Joined: Sun Mar 22, 2009 1:27 pm

Re: [RC2] Quote Post Back Link

Post by franfj » Sun Apr 19, 2009 11:36 am

I get the same error as naduvko, and if I try to quote in a PM it doesn't parse it as a quote I get this:

Code: Select all

[quote="USERX":]
Mesage X....
...[/quote:]
As you can see it ads ":" at the end of the Quote...

I think that a possible solution is use the original Quote for PMs, I will try it...

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: [RC2] Quote Post Back Link

Post by Erik Frèrejean » Sun Apr 19, 2009 1:27 pm

I'm not sure what the differences are between quotes in posts and PMs that can cause this. I'm going to have a close look into this but not sure when I've time to do so.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

lugsciath
Registered User
Posts: 316
Joined: Tue Oct 02, 2007 11:12 am

Re: [RC2] Quote Post Back Link

Post by lugsciath » Wed Apr 22, 2009 9:14 pm

At the moment i have such kind of "workaround", im using a bbcode for setting a quote with backlink, but this isnt set automaticly :( ... waiting for a solution.

LG

Uwe

Jiero
Registered User
Posts: 11
Joined: Wed Jan 30, 2008 7:05 pm

Re: [RC2] Quote Post Back Link

Post by Jiero » Mon May 04, 2009 7:33 am

Anyasha wrote: And if I submit, the quote looks like this:

Admin& Qpbl Wrote In: Re: test:
I'm having the same problem. I followed these instructions:
naduvko wrote: In viewtopic.php
find

Code: Select all

$auth->acl($user->data);
Add these on a new blank line after the preceding line(s) to find

Code: Select all

$user_lang = $user->add_lang('mods/language_qpbl');
I was able to get rid of the Qpbl part but the & next to the Username still shows. How can I fix this?

Wydrah
Registered User
Posts: 57
Joined: Tue Nov 11, 2008 5:58 am

Re: [RC2] Quote Post Back Link

Post by Wydrah » Sat May 23, 2009 5:25 pm

Jiero wrote:
Anyasha wrote: And if I submit, the quote looks like this:

Admin& Qpbl Wrote In: Re: test:
I'm having the same problem. I followed these instructions:
naduvko wrote: In viewtopic.php
find

Code: Select all

$auth->acl($user->data);
Add these on a new blank line after the preceding line(s) to find

Code: Select all

$user_lang = $user->add_lang('mods/language_qpbl');
I was able to get rid of the Qpbl part but the & next to the Username still shows. How can I fix this?
I am waiting for this fix, as well.

naduvko
Registered User
Posts: 9
Joined: Sun Mar 29, 2009 2:34 pm

Re: [RC2] Quote Post Back Link

Post by naduvko » Sat May 23, 2009 5:28 pm

naduvko wrote:
Erik Frèrejean wrote:Finally had time to look at these:
Anyasha wrote:Not only does the quote cut off the first letter of what was quoted,
I can't replicate this issue.
in functions_qpbl.php
Find

Code: Select all

	// Replace withing the given offset
	$message = substr_replace($message, "";p="{$post_id}"]", ($begin_pos+1), $tag_end_length);
and Replace with

Code: Select all

    // Replace withing the given offset
    $message = substr_replace($message, "";p="{$post_id}"]", $begin_pos, $tag_end_length); 
Erik Frèrejean wrote:
Anyasha wrote:And if I submit, the quote looks like this:

Admin& Qpbl Wrote In: Re: test:
Did you made the language changes? Can you post your bbcode.html?
In viewtopic.php
find

Code: Select all

$auth->acl($user->data);
Add these on a new blank line after the preceding line(s) to find

Code: Select all

$user_lang = $user->add_lang('mods/language_qpbl');
First part is fixing the problem.

evina
Registered User
Posts: 110
Joined: Mon Nov 10, 2008 2:06 am

Re: [RC2] Quote Post Back Link

Post by evina » Mon Jun 15, 2009 5:37 pm

Got a few questions...

This messed up my board when I tried it. Is that becasue I have the QUBL also installed? I thought you said that there was a way to get around this. What does the "Advanced Quoting" mod do?

autinhyeu
Registered User
Posts: 685
Joined: Mon Apr 14, 2008 6:34 am
Location: Vietnamese
Contact:

Re: [RC2] Quote Post Back Link

Post by autinhyeu » Mon Jun 15, 2009 6:30 pm

evina wrote:Got a few questions...

This messed up my board when I tried it. Is that becasue I have the QUBL also installed? I thought you said that there was a way to get around this. What does the "Advanced Quoting" mod do?
The same question ;)
And, when i try edit posting.php...
i found:

Code: Select all

$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
don't have:

Code: Select all

$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]'
Thanks...
phpBB Community in Vietnamese: http://www.phpbbvn.com

Sorry, my English language is fine impossible

naduvko
Registered User
Posts: 9
Joined: Sun Mar 29, 2009 2:34 pm

Re: [RC2] Quote Post Back Link

Post by naduvko » Mon Jun 15, 2009 7:06 pm

parser not working with cyrillic usernames :(

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: [RC2] Quote Post Back Link

Post by Erik Frèrejean » Mon Jun 15, 2009 8:51 pm

evina wrote:Got a few questions...

This messed up my board when I tried it. Is that becasue I have the QUBL also installed? I thought you said that there was a way to get around this. What does the "Advanced Quoting" mod do?
What part is messed up?
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

Locked

Return to “[3.0.x] MODs in Development”