phpBB2 Mods Forum Index phpBB2 Mods
A demo forum demonstrating my mods
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   TV GuideTV Guide   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Mod Download [v2.1.4]

 
 
Post new topic This topic is locked: you cannot edit posts or make replies.
   phpBB2 Mods Forum Index -> Autolinks [v2.1.4]
View previous topic :: View next topic  
Author Message
Afkamm
Site Admin


Joined: 22 Sep 2004
Posts: 568
Location: Scotland

PostPosted: Wed Apr 06, 2005 1:00 am    Post subject: Mod Download [v2.1.4] Reply with quote

Code:
#################################################################
## MOD Title:      Autolinks For phpBB2 Mod
## MOD Author:      Afkamm < phpbb_AT_afkamm.co.uk > (N/A) http://mods.afkamm.co.uk
##
## MOD Description:   Automatically turns keywords in messages into links.
##
## MOD Version:      2.1.4
## phpBB Version:   2.0.21
##
## Installation Level:   Intermediate
## Installation Time:   15 Minutes
##
## Files To Edit: 11
##         index.php
##         posting.php
##         privmsg.php
##         viewtopic.php
##         admin/admin_board.php
##         includes/bbcode.php
##         includes/constants.php
##         includes/functions.php
##         includes/topic_review.php
##         languages/lang_english/lang_admin.php
##         templates/subSilver/admin/board_config_body.tpl
##
## Included Files: 2
##         admin/admin_autolinks.php
##         templates/subSilver/admin/autolinks_body.tpl
##
#################################################################


Based on Post-Nuke autolinks, this MOD borrows heavily from the code with some small alterations.

Features
  • Assign a keyword to any and all forums.
  • Convert only the first of each keyword into a link, or all.
  • Give each link its own distinctive CSS style.
  • Order your keywords so Google Maps and Google will both work.
  • Counter so you can see how often a autolink is clicked.
  • Viewing permissions so you can set who sees which autolink.

For the 2nd feature, you'll find that option in the ACP configuration page. Smile|-1



Autolinks_For_phpBB2_MOD.zip
 Description:
Autolinks for phpBB2

Download
 Filename:  Autolinks_For_phpBB2_MOD.zip
 Filesize:  12.37 KB
 Downloaded:  2064 Time(s)


_________________
Marc Smile|-1
Remember, Google is your friend.


Last edited by Afkamm on Fri Sep 01, 2006 10:49 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Afkamm
Site Admin


Joined: 22 Sep 2004
Posts: 568
Location: Scotland

PostPosted: Sun Aug 13, 2006 7:03 pm    Post subject: Reply with quote

There's currently a bug that appears when you have quotes within quotes. In the install file, when asked to do the following...
Code:
#
#-----[ OPEN ]---------------------------------------------------
#
includes/bbcode.php

#
#-----[ FIND ]---------------------------------------------------
#
   // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff.
   $text = str_replace("[quote:$uid]", $bbcode_tpl['quote_open'], $text);
   $text = str_replace("[/quote:$uid]", $bbcode_tpl['quote_close'], $text);

   // New one liner to deal with opening quotes with usernames...
   // replaces the two line version that I had here before..
   $text = preg_replace("/\[quote:$uid=\"(.*?)\"\]/si", $bbcode_tpl['quote_username_open'], $text);

#
#-----[ REPLACE WITH ]-------------------------------------------
#
// Start Autolinks For phpBB2 MOD
/*
   // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff.
   $text = str_replace("[quote:$uid]", $bbcode_tpl['quote_open'], $text);
   $text = str_replace("[/quote:$uid]", $bbcode_tpl['quote_close'], $text);

   // New one liner to deal with opening quotes with usernames...
   // replaces the two line version that I had here before..
   $text = preg_replace("/\[quote:$uid=\"(.*?)\"\]/si", $bbcode_tpl['quote_username_open'], $text);
*/
   $text = bbencode_second_pass_quote($text, $uid, $bbcode_tpl);
// End Autolinks For phpBB2 MOD

...don't do it. Ignore this part and I'll try and fix the bbencode_second_pass_quote() function that's called. Smile|-1

_________________
Marc Smile|-1
Remember, Google is your friend.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Afkamm
Site Admin


Joined: 22 Sep 2004
Posts: 568
Location: Scotland

PostPosted: Wed Aug 16, 2006 9:43 pm    Post subject: Reply with quote

To fix the order bug (when you deleted an autolink the order got messed up) in v2.1.2 to become v2.1.3 do the following

Code:
#
#----[ OPEN ]------------
#
admin/admin_autolinks.php

#
#----[ FIND ]------------
#
   $id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : '';

#
#----[ REPLACE WITH ]----
#
   $id = ( isset($HTTP_POST_VARS['id']) ) ? $HTTP_POST_VARS['id'] : '';

#
#----[ FIND ]------------
#
         $hidden_fields = '<input type="hidden" name="save" value="me" /><input type="hidden" name="delete" value="1" /><input type="hidden" name="id" value="' . $link_id . '" />';

#
#----[ INLINE, FIND ]----
#
<input type="hidden" name="id" value="' . $link_id . '" />

#
#----[ REPLACE WITH ]----
#
<input type="hidden" name="id" value="' . $link_id . '|' . $link_order . '" />

_________________
Marc Smile|-1
Remember, Google is your friend.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Afkamm
Site Admin


Joined: 22 Sep 2004
Posts: 568
Location: Scotland

PostPosted: Fri Sep 01, 2006 10:43 am    Post subject: Reply with quote

Thanks to femu for finding a bug. Here's the fix to take 2.1.3 to 2.1.4

Code:
#
#----[ OPEN ]-----
#
includes/functions.php

#
#----[ FIND ]-----
#
function obtain_autolink_list(&$orig_autolink, &$replacement_autolink, $forum_id)
{
   global $db, $userdata;

#
#----[ INLINE, FIND ]-----
#
$userdata

#
#----[ AFTER ADD ]-----
#
, $phpEx

#
#----[ FIND ]-----
#
append_sid(index.$phpEx) . '?lurl='

#
#----[ REPLACE WITH ]-----
#
append_sid("index.$phpEx") . '?lurl='

#
#----[ SAVE/CLOSE FILE ]-----
#

_________________
Marc Smile|-1
Remember, Google is your friend.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
  Post new topic This topic is locked: you cannot edit posts or make replies.
   phpBB2 Mods Forum Index -> Autolinks [v2.1.4] All times are GMT + 1 Hour

Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


 


Powered by phpBB © 2001, 2005 phpBB Group