1. Display the author details in fullstory

Display the author details in fullstory

  |   7
Display the author details in fullstory
There are a lot of websites especially web blogs, using wordpress and some other CMS scripts, when they publish articles, they display the author information under the articles, for DLE users, there are some people keep asking me how to display those details in fullstory? here is the final code I have come up with, easy and quick install this hack....

Here is the example of what you will see
Display the author details in fullstory

In screenshot about, the details of the user who posted that article showing user avatar, username, usergroup, registration date, location, and information...

- The user avatar will query from database table for avatar image, if no avatar it will use default theme avatar image, db table row "foto"
- username, this tag is no need for extra database query because in fullstory.tpl you can use default tag {author}-user with link and {login}-username without link
- usergroup, is the group of that user belong to, this tag will query database from table row "user_group"
- registration date, display that date of user registered in your site with date and time stamp, database table row to query "reg_date"
- location, display the user location which by default it will query from database "land" which usually using tag {land} in user profile
- information, display the short information from user profile {info} tag, which query from database table row "info"
Please note that installing hacks and modules in Datalife Engine are always required additional queries to database regardless of hacks and modules you use, will always use additional server query and resources, like it or not it's reality in every single script and CMS, so DLE is the same, no exception!

Installation


Install this hack is very simple, copy and paste the code in /engine/modules/show.full.php and add tags in your theme fullstory.tpl and customize your style any ways you want and any languages you like...!

1) Open /engine/modules/show.full.php
Find:
Information!You must register before you can view this text. Please register or Login
Before Add:
Information!You must register before you can view this text. Please register or Login

2) Open your {THEME}/fullstory.tpl and add the following tags in it using any of your languages and style, tags to use
  • {usfoto} : display author avatar, this require proper html for image because the tag will only provide the url to avatar, so you will need img tag (see example code I use below for example.
  • {upm-link} : display the link to send author PM, this also require proper html code for link because this tag will only provide the url to send pm to that specific user ID, so you will need a tag <a>, see the example below
  • {usinfo} : display the user short information, this tag is the same as {info} in user profile
  • {usregister} : display the user registration date, the default is in format "19 October 2011 01:50" (date month year hour minute) but you can easily change it in show.full.php
    $tpl->set( '{usregister}', langdate( "j F Y H:i", $usrow['reg_date'] ) );
    you will see the format is "j F Y H:i" which will get result as "19 October 2011 01:50", these format are normally most used:
    - j F Y H:i (default)
    - F j, Y H:i (display as October 19, 2011 01:50)
    - F j, Y (display as October 19, 2011) without hour and minute
    - F j, Y H:i (display as October 19, 2011 01:50)
    - M j, Y (display as Oct 19, 2011)
    - j/m/Y (display as 19/10/2011)
    For more information about date-time setting, please use help popup windows in DLE Admin CP for Date format: in system settings
  • {usfullname} : Display user full name, this tag is as same as {fullname} tag in user profile and queried from same database table
  • {usland} : display the user location, this tag is same as tag {land} in user profile and queried from same database table
  • {usgroup} : display the usergroup that author belong to, the tag is also contain the style for usergroup you set in "Usergroup Settings (Manager) in DLE Admin CP which will query prefix from that setting so the user group color or bold or any formats you set there will display here as well

Example code used in demo screenshot above:

Information!You must register before you can view this text. Please register or Login
CSS:
Information!You must register before you can view this text. Please register or Login
Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.

Details

+30

Comments 7

mrfly911
mrfly911
Members
Commented By mrfly911 on July 12, 2012 (9:17 am)
Greate job!
Thank friend thumbsup
N/A 5Forum topics : 7Forum replies : 21Forum likes : 0

I love DLE.
It is my website:
http://nguoianphu.com
wizardbg
wizardbg
Members
Commented By wizardbg on December 27, 2013 (8:49 am)
just tested in 10.1 and is working just as my girlfriend wanted :D how do i put it on top before article photo?

btw i noticed when i try to click change profile on any template it doesn work , anyone has that problem in 10.1 or i have deleted some file by mistake?
N/A 17Forum topics : 2Forum replies : 6Forum likes : 0
yorismith
yorismith
Moderators
Commented By yorismith on December 27, 2013 (7:29 pm)
If you see the section "Example code used in demo screenshot above" you will get the code, so you have to add it wherever you want the details to display in your theme file "fullstory.tpl" only, you can't add the code in editor when add news/article, so to answer to your question is depending on how you add your article image, if you use xfield then it's easy to manipulate the position where to add it, but if you add article photo within {full-story} text area then you have to add the html code "Example code used in demo screenshot above" before {full-story} so it will display above everything.

I tested it with DLE 10.1 the problem on change profile maybe because the cache or if you are trying to make changes admin account details then try to make change in user profile or in admin cp instead, however, I don't see any problems...I tested and changing profile details doesn't concern this hack and the popup using standard {author} tag which is not part of this hack...
32 288Forum topics : 2Forum replies : 699Forum likes : 117

- Nothing comes free...
- A generous heart, kind speech, and compassion are the things which renew humanity
wizardbg
wizardbg
Members
Commented By wizardbg on December 28, 2013 (6:06 am)
thanks , i had it under {full-story} .... now is on top i may try to add icon for pm link bully
to fix the edit profile issue {not related to this module!} i found from somewhere and added to htaccess
RewriteRule ^user/([^/]*)/settings(/?)+$ index.php?subaction=userinfo&user=$1&a=settings [L]

Dont have idea what it does but without it it throws me off to a byethost random page , now
profile is edited just it doesnt says nothing like : "profile edited" if it is supposed to....
4 days and the website is 60% ready , i find dle easy to edit even for non-coders and good alternative to wordpress and etc scripts :D
How do i add favicon to shows up and go to top button like here?How do i add new font for articles?
yorismith i see u have testing site on free byethost too, is there any good free hosting cuz byet has bandwich and concurent sessions so low i `ve reached half my limits a day just while edditing stuff :D
N/A 17Forum topics : 2Forum replies : 6Forum likes : 0
yorismith
yorismith
Moderators
Commented By yorismith on December 28, 2013 (11:38 am)
I don't know about that setting but it seems like extra module which I don't think it comes with DLE by default option

Edit profile doesn't have any confirmation message telling you it was updated or successful (it's just the way DLE works I think) as far as I know, it's only telling you if you input wrong information or invalid info

Adding favicon is simple because you can usually just upload favicon.ico to the root of site directory then it will show on any browsers, if you want it to show up right the way then you can specify in /templates/your-theme/main.tpl under {headers} or before before </head>
<link rel="shortcut icon" href="/favicon.ico" />

For free webhost...you will not be able to find any free good and reliable host out there without limitations...it's just business. but you can try hostinger.com
32 288Forum topics : 2Forum replies : 699Forum likes : 117

- Nothing comes free...
- A generous heart, kind speech, and compassion are the things which renew humanity
Cricku
Cricku
V.I.P.
Commented By Cricku on May 27, 2014 (3:54 pm)
How to install the hack for using the tags in addcomments.tpl ?

Thanks!
N/A 1Forum topics : 5Forum replies : 16Forum likes : 0
yorismith
yorismith
Moderators
Commented By yorismith on May 27, 2014 (7:34 pm)
you can't add "author" in addcomment.tpl because add comment doesn't belong to any "author", what are you trying to do?
32 288Forum topics : 2Forum replies : 699Forum likes : 117

- Nothing comes free...
- A generous heart, kind speech, and compassion are the things which renew humanity
Information!Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.
DLEStarter Notice!Please note...Every hack and every module will get additional queries from your database and some hacks and some modules may result your server overload, so install only what you "need", remove any hacks and modules from your script when you don't need them, all hacks and modules appears in this website are not guaranteed by DLEStarter Team for your script security and compatibility, please read instruction carefully and use hacks and modules at your own risk...Thank you.