8:14 pm
Mood: na

Description: This allows for separate display of author penname, contact link, and the add author to favorites link in user.tpl.

This is just an itty bitty mod I cooked up for my own site. I figured I might as well slap it up here.

As usual, back up your files before you attempt this. You know the drill. ^_^

Requirements: eFiction 2.0

Difficulty: Easy

Modification History:
- 30 November, 2005 -- Mod released

Files Involved:

  • viewuser.php
  • skins/YOURSKIN/user.tpl

Modification & Support: eFiction.org

Instructions:

 

Open: viewuser.php

Go to line 66 or so and look for this:

PHP:
  1. if($userinfo[bio]) {
  2.         $bio = nl2br($userinfo[bio]);   
  3.         $tpl->assign("bio", stripinput($bio));
  4.     }

As a small note, this is a good spot to add most any user page mods that require "if" statements to work.

I'm providing two different versions of each link, just so everyone can have their choice. Yes, you can use them all if you want. Just paste them one after another, making sure you don't delete anything in the process.

 

For Separate display of "Add Author to Favorites" (image link):

PHP:
  1. if($favorites == "1" && $loggedin == "1") $tpl-> assign("favimg", "<a href=\"viewuser.php?uid=$useruid&amp;action=addfav&amp;author=$userinfo[uid]\" title=\""._ADDAUTHOR2FAVES."\"><img src=\"images/fav.gif\" border=\"0\" alt=\""._ADDAUTHOR2FAVES."\"/></a>");

For Separate display of "Add Author to Favorites" (text link):

PHP:
  1. if($favorites == "1" && $loggedin == "1") $tpl-> assign("fav", "[<a href=\"viewuser.php?uid=$useruid&amp;action=addfav&amp;author=$userinfo[uid]\" title=\""._ADDAUTHOR2FAVES."\">"._ADDAUTHOR2FAVES."</a>]");

 

For Separate display of "Contact" (image link):

PHP:
  1. if($userinfo[email]) $tpl-> assign("contact_img", "<a href=\"viewuser.php?action=contact&amp;uid=$_GET[uid]\" title=\""._CONTACT."\"><img src=\"images/mail.gif\" border=\"0\" alt=\""._CONTACT."\"/></a>");

For Separate display of "Contact" (text link):

PHP:
  1. if($userinfo[email]) $tpl-> assign("contact", "[<a href=\"viewuser.php?action=contact&amp;uid=$_GET[uid]\" title=\""._CONTACT."\">"._CONTACT."</a>]");

 

And last, but not least, the penname display:

PHP:
  1. $tpl->assign("penname", $userinfo[penname]);

 

To make them appear on your user page, just put these in the user.tpl file where you want them to appear.

{fav} -- Add author to favorites text link
{favimg} -- Add author to favorites image link
{contact} -- Contact text Link
{contact_img} -- Contact Image Link
{penname} -- User Penname

Save, upload, and enjoy! ^_^

You can leave a response, or trackback from your own site.

Leave a Reply