boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Auto convert your friend's names into links
Goto page 1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
annia



Joined: 09 Apr 2002
Posts: 18

PostPosted: Sun Sep 01, 2002 10:55 am    Post subject: Auto convert your friend's names into links Reply with quote

I duplicated and edited the smiley converter script a little bit so that it works now as a auto converter for your friend's names :) like if you type dodo after you posted the entry it will become dodo

Just copy and past the codes below into the intended *.php files (you find them all in the b2-include folder).

b2vars.php > the friends array.. customize it to your own friends:
Code:
$friendstrans = array(
      'daynah'      => 'girl.daynah.net',
      'dodo'      => 'www.pure-essence.net'   );



b2vars.php > copy and paste:
Code:

# generates friends' search & replace arrays
foreach($friendstrans as $friend => $url) {
   $friendssearch[] = $friend;
   $friend_masked = '';
   for ($ii = 0; $ii < strlen($friend); $ii = $ii + 1) {
      $friend_masked .= substr($friend, $ii, 1);
   }
   $b2_friendsreplace[] = "<a href='http://$url' target='_blank'>$friend_masked</a>";
}


b2functions.php > copy and paste:

Code:
function convert_friends($content) {
   
   global $friendssearch, $b2_friendsreplace;
   
      $content = str_replace($friendssearch, $b2_friendsreplace, $content);
   
   return ($content);
}


b2template.functions.php:
Search for the function the_content and simply add the line $content=convert_friends($content); .. it should look like this:

Code:
function the_content($more_link_text="(more...)",$stripteaser="0",$more_file="") {
   $content = get_the_content($more_link_text,$stripteaser,$more_file);
   $content = convert_bbcode($content);
   $content = convert_gmcode($content);
   $content = convert_smilies($content);
   $content=convert_friends($content);
   $content = convert_chars($content,"html");
   echo $content;
}


Hope that helps :)
Back to top
View user's profile Send private message
turtelina



Joined: 25 Jan 2002
Posts: 42
Location: Austria

PostPosted: Sun Sep 01, 2002 1:15 pm    Post subject: Cool! Reply with quote

Hey Annia,

That´s going to be so very useful! Thank you so very much for that hack. Razz

Connie
Back to top
View user's profile Send private message Visit poster's website
Glutnix



Joined: 28 Mar 2002
Posts: 32
Location: New Zealand

PostPosted: Tue Sep 03, 2002 7:59 am    Post subject: Reply with quote

nice work! I've added Michel to my list
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
.Chris



Joined: 30 Apr 2002
Posts: 186
Location: Hawaii

PostPosted: Thu Sep 05, 2002 6:59 pm    Post subject: Reply with quote

O wowie and there's so many other things you can use it for.

Thanks!
Back to top
View user's profile Send private message Visit poster's website
Gadget Girl



Joined: 25 Jan 2002
Posts: 305
Location: Virginia

PostPosted: Tue Sep 24, 2002 4:02 pm    Post subject: Reply with quote

Thank you for this, way cool!

Smile Sara
Back to top
View user's profile Send private message
Cine



Joined: 22 Sep 2002
Posts: 22
Location: Lost

PostPosted: Tue Sep 24, 2002 7:01 pm    Post subject: Reply with quote

It looks so cool but I can't get it work! I can't really understand where to put in the codes too.. Help please?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Gadget Girl



Joined: 25 Jan 2002
Posts: 305
Location: Virginia

PostPosted: Tue Sep 24, 2002 7:17 pm    Post subject: Reply with quote

I posted this hack on my tutorial page: www.graphics-by-sara.com/tutorials/ Maybe that will help you! Smile
Back to top
View user's profile Send private message
Cine



Joined: 22 Sep 2002
Posts: 22
Location: Lost

PostPosted: Tue Sep 24, 2002 7:49 pm    Post subject: Reply with quote

It didn't Sad Maybe you can make a zip?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Gadget Girl



Joined: 25 Jan 2002
Posts: 305
Location: Virginia

PostPosted: Tue Sep 24, 2002 9:16 pm    Post subject: Reply with quote

Make a zip of what?

If you read the code that I posted or that is in this thread, it does say where to put the code, exactly.

Sorry I couldn't help you.
Back to top
View user's profile Send private message
Cine



Joined: 22 Sep 2002
Posts: 22
Location: Lost

PostPosted: Wed Sep 25, 2002 7:44 pm    Post subject: Reply with quote

Ish ok. I have tried to install it many times but it won't work.. I just wondered if you could zip the files used, when the code is pasted and send them to me?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
.Chris



Joined: 30 Apr 2002
Posts: 186
Location: Hawaii

PostPosted: Wed Sep 25, 2002 9:09 pm    Post subject: Reply with quote

Cine
You need to edit the B2 files that already exist. If you don't understand her very clear and helpful tutorial, I suggest that you abandon trying to use this altogether.
Back to top
View user's profile Send private message Visit poster's website
Gadget Girl



Joined: 25 Jan 2002
Posts: 305
Location: Virginia

PostPosted: Thu Sep 26, 2002 4:59 pm    Post subject: Reply with quote

Ok, Cine...I will tell you what. I will charge you my flat tech rate of $15 USD an hour to do this for you. I will need the following in your email to me:

Your FTP info, domain name, passwords. If you are really sure you want to have someone do this for you, it will be done.

Smile

Thanks, Chris, I'm trying to get them up and running~

Sara
Back to top
View user's profile Send private message
Cine



Joined: 22 Sep 2002
Posts: 22
Location: Lost

PostPosted: Fri Sep 27, 2002 6:05 pm    Post subject: Reply with quote

I don't think I want to pay you. Maybe you missunderstood me. I just asked if you could send me the b2vars, b2functions and b2template.functions file. If I have to pay you.. I won't.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
.Chris



Joined: 30 Apr 2002
Posts: 186
Location: Hawaii

PostPosted: Fri Sep 27, 2002 6:51 pm    Post subject: Reply with quote

L O L
Back to top
View user's profile Send private message Visit poster's website
Gadget Girl



Joined: 25 Jan 2002
Posts: 305
Location: Virginia

PostPosted: Sun Sep 29, 2002 5:45 pm    Post subject: Reply with quote

Well, Cine, if I did all that work for you, I would want to be paid and the payment up front. Why not take a look at this thread and the tutorial again?

Very Happy Chris
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
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


Powered by phpBB 2 © 2001, 2002 phpBB Group