vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Forum Display Enhancements - Alternate Last Post Display (https://vborg.vbsupport.ru/showthread.php?t=214832)

IdanB 05-28-2009 10:00 PM

Alternate Last Post Display
 
1 Attachment(s)

Alternate Last Post Display
By: Idan B.

1. Description & Usage:
Alternate Last Post hack will allow the forum admin to make the "Last Post" column on forum look different (have another/better layout):
Hack will make it with user avatar picture & instead of showing post date, it will show "time diff" since the post (for example: 4 Hours, 5 Minutes ago") - See pictures in attachment for better understanding. :up:
This Hack can be enabled on both Forum Home & forum Display or Forum Display Only.
The hack was develop for request of Theater (request was made here: https://vborg.vbsupport.ru/showthread.php?t=214212 )
I assumed this request might be "handy" to other users of community, so developed it to be a fully working modification.

2. Installation:
Please click Mark as Installed.
Installation is pretty easy - just download & install:
  • Extract zip for product xml & no-avatar picture.
  • Goto: AdminCP->Plugin System->Manage Products : Choose "Add/Import Product" and import this product xml (product-alt_last_post.xml)
  • Upload the "anonymous_avatar.gif" file onto /images/avatars/ directory. If testing it on your develop board, be sure to upload there as well.
3. Upgrade From Older Version:
1. uninstall previous version
2. Download new version xml & install as instructed in previous section.

4. Configuration:
Once installed, the "Vbulletin Options" under admincp will have extra section:
Section name: "Alternate Last Post Display"
  • Enabled ? - Yes/No (default YES)
  • Enable on Forum Home ? - Yes/No (default NO)
  • Enable on Forum Display ? - Yes/No (default YES)
  • Use "Last Post" text as title ? - Yes/No (default YES)
  • Show differential time ? - Yes/No (default YES)
  • Align "Never" to LEFT ? - Yes/No (default YES)
  • Use profile picture instead of avatar ? - Yes/No (default NO)
  • Picture width - INT (default: 40)
  • Picture height - INT (default: 40)
5. Known Bugs:
  • Forum Tabbbed modification has known competability with this mod - result it is not showing on forumhome. Currently debugging this one to allow fix on next version.
  • v1.1.4 released. Since v.1.1.0 code was re-writeen completely from "scratch" and now it should support multi-languages (other than english) ! Note: Cyrillic & Latin chars reported to have some issues, still under check)
  • See changelog below for full description of stuff fixed.

6. TO-DO's LIST (Next Versions):
  • Allow thread view option on admincp.
  • Other mods (such as Forum Tabbed Modification) conflict fixes - under checking !.
  • [S]Admincp option to set avatar width/height.[/S] added in v.1.1.4
  • [S]Admincp option to select between profile and avatar picture.[/S] added in v.1.1.4

NOTE: Currently supported format chars for date/time (v1.1.4) are :
Date: "j","d", "m", "n", "F", "M", "Y", "y","S"
Time: "h", "H", "g", "G", "i", "s", "a", "A".
Any other chars will result with Post Time: N/A displayed !


NOTE: i've left v1.1.3 and added in addition the v1.1.4, just in case anyone has problem, he can download old version & rollback.

Enjoy hack & dont forget to click Mark as Installed :)

IdanB 05-29-2009 10:45 AM

12 Jun 2009 (19:20) - Version 1.1.4 released :
  • FEATURE ADD: The template used for this mod no longer resides inside plugin code. Now it's installed as new template, so everyone can edit for their own needs.
  • FEATURE ADD: New admincp option: set width/height of picture shown
  • FEATURE ADD: New admincp option: allow selection between avatar and profile picture
  • FEATURE ADD: Now mod supports date format string with "j" & "S" chars.

06 Jun 2009 (20:25) - Version 1.1.3 released :
  • BUG FIX: Fixed regexp again to support more non-english chars on date.
  • VISUAL FIX: avatar picture now set to 40x40, so any non square pictures wont look "ugly" on display.
  • ADMINCP OPTION REMOVED: vbSEO admincp option removed - now works automatically inside code, doesnt need to select it
  • ADMINCP OPTION ADDED: select time display : differential (xxx ago) or orignal date & time as configured for vbulletin
  • ADMINCP OPTION ADDED: select "align to left" for the "Never" (if forum has no posts

05 Jun 2009 (21:08) - Version 1.1.2 released :
  • BUG-FIX: Fixed regexp to better support non-english chars on date
  • FEATURE-REMOVED: "D" letter on date time format not supported. I was mistaken at first to think i could. Having date showing as "Sunday" rather than number of day (1..31) doesnt allow me to take that & gnerate exact date from it. Therefore, this letter has been removed & no longer supported!

05 Jun 2009 (19:35) - Version 1.1.1 released :
  • BUG-FIX: Add code that handle case where last post showing poster nick of user that doesnt exsits anymore inside db (eg. deleted). In the above case, the profile link will be showing as "User Was Deleted From DB"
  • BUG-FIX: changed name of vars used in templates to have known prefix, should avoid any chance of conflict with some other mod.

05 Jun 2009 (13:15) - Version 1.1.0 released :
  • Code was re-written. Now mod support any language.
  • New admincp options for both vbSEO & the text used for thread title.

30 May 2009 (13:15) - Version 1.0.3 released :
  • BUG-FIX: now supporting any date / time string that user configured into admincp. Note the following chars are supported: "d","m","n","D","F","M","Y","y","h","H","g","G","i ","s","a","A"
  • BUG-FIX: nicks now support space (also vbSEO fix that convert space to +)
  • FEATURE-ADD: Yesterday/Today & by now used as part of vbphrase & not hard-coded into plugin code.
  • BUG FIX: avoid any case of negative time in some condition.
  • VISUAL-FIX: added LEFT align inside Last Post column, so it will look much better.
  • Note: till any official announcement, this modification does not support any non-english boards (date locale will not be matched so likely to show Post Time N/A). I'm still trying to find workaround that will support any language & not attempt to patch code to be language specific.

29 May 2009 (18:33) - Version 1.0.2 released :
  • BUG-FIX: all mktime() added precondition to determine the nature of vars passed to it, to avoid input it with NULL. Should time variable(s) be missing, the hack will display "Post Time N/A" (phrase named: alt_lp_post_time_na);
  • vbSEO should now be fully fixed to show links correclty & according to vbSEO way. Eventually, no admincp were added, this was auto detected inside code.
  • BUG-FIX: some more extra checking were added to avoid some other coding pitfalls.

29 May 2009 (16:46) - Version 1.0.1 released :
  • BUG-FIX (*): did not read thread link correctly with vbSEO installed. This should be fixed & working - please report any further problems. (*) Note this still display links using showthread.php & member.php . Further support to vbSEO will be available on v.1.1.0 due to be released by tonight/tomorrow.
  • BUG-FIX: The table missing NOWRAP tag, so if skin doesnt set minimum width to "Last Post" column, it will looked bit streched.
  • BUG-FIX: Global plugin enable/disable option on admincp didnt work properly
  • BUG-DIX: date that was showing as "Yesterday" / "Today" was not properly handled by code. now fixed.
  • FEATURE-ADD: All text were created as phrases, allowing easy translation without need to go into code:
    phrases added are:
    alt_lp_last_post
    alt_lp_by
    alt_lp_years
    alt_lp_year
    alt_lp_weeks
    alt_lp_week
    alt_lp_days
    alt_lp_day
    alt_lp_hours
    alt_lp_hour
    alt_lp_min
    alt_lp_mins
    alt_lp_sec
    alt_lp_secs
    alt_lp_ago

4nawadir.com 05-29-2009 10:57 AM

Nice mod
Installed
will be translated to arabic

4nawadir.com 05-29-2009 11:04 AM

there is a probleme
you can see it here
http://leenkat.com/vbtest/forumdisplay.php?f=1

IdanB 05-29-2009 11:07 AM

Quote:

Originally Posted by 4nawadir.com (Post 1819432)
there is a probleme
you can see it here
http://leenkat.com/vbtest/forumdisplay.php?f=1

Did you upload the no avatar image to the images/avatar/ folder ?
if you look at the missing image path you'll see it's looking for:
http://www.leenkat.com/vbtest/images...ous_avatar.gif
that isnt there. Upload it.

Also note if you translate this you might need to go into code, as the "Last Post" & days/weeks/minutes text are hardcoded into plugin.
I'll try to place these expressions text out to vbphrase on next version.

EDIT: about the block width, it depands on skin, lemme try to place spacer gif to make this better.

EDIT2: wait 10m, will place text into phrase & will force minimum width to block, so your skin wont wrap text to break it.

4nawadir.com 05-29-2009 11:20 AM

Done i upload it
but there is an author probleme
see it

IdanB 05-29-2009 11:27 AM

Quote:

Originally Posted by 4nawadir.com (Post 1819435)
Done i upload it
but there is an author probleme
see it

Like said, it's the skin thingy.
Gimme 10 minutes, i'll upload v1.0.1 that has both external phrases for every text & i'll also place some spacer inside table to force minimum width to colum.

saviola8x 05-29-2009 11:40 AM

Not work on forum install vbSEO ~~"

IdanB 05-29-2009 11:45 AM

Quote:

Originally Posted by saviola8x (Post 1819443)
Not work on forum install vbSEO ~~"

gimme html fragement of the link as seen by vbSEO when install, i'll re-do the regexp to support them as well

EDIT: gimme an hour, it will fixed now. will be working on v.1.0.1 once uploaded.

IdanB 05-29-2009 01:00 PM

Version 1.0.1 posted.
Read changelog for full details of what's fixed & changed.

Few notes about vbSEO:
  1. a "work-around" patch was made to make modification work with vbSEO installed till next version is out (1.1.0).
  2. Patched revision allows to read vbSEO links & properly "translate" it to non-vbSEO links (showthread.php & member.php).
    Note: since the vbSEO knows to read normal links and convert them to it's own link, it still works. Yea, i'm aware the vbSEO users would want the links to show same as vbSEO display it. That will be implnated as admincp option in next revision as mentioned above.

hotwheels 05-29-2009 01:04 PM

Okay, right now it isn't working in forumdisplay in its default mode. When i set the second setting to no so the product will show on forumhome, it works, but i have this error all over the place "Warning: mktime() expects parameter 1 to be long, string given in [path]/includes/functions_forumlist.php(393) : eval()'d code on line 387"

Great idea though

IdanB 05-29-2009 01:09 PM

Quote:

Originally Posted by hotwheels (Post 1819500)
Okay, right now it isn't working in forumdisplay in its default mode. When i set the second setting to no so the product will show on forumhome, it works, but i have this error all over the place "Warning: mktime() expects parameter 1 to be long, string given in [path]/includes/functions_forumlist.php(393) : eval()'d code on line 387"

Great idea though

o.O

ok, investigating it it now.
Changed mod status to beta till this matter resolved.
Expect revision update to fix this within next hour.

hotwheels 05-29-2009 01:19 PM

Awesome........thanks.

IdanB 05-29-2009 02:47 PM

version 1.0.2 uploaded.
Please report any problems.
The vbSEO should now be fully fixed, inlcuding links fix.

Once i'll get feedback this is working properly, i'll remove the beta status.

Extra Notes:
should any user see "Post Time NA", please be sure to check this plugin on default skin too before posting feedback & mention if this fails on both of the skins.
Since this plugin uses regular expression to fetch certain information (post time & link of last post) it is possible that someone has way-custom skin installed, a skin that not using "default" format for the "last post" (most custom skins are ok, so this should be rare case, but it's possible)

Hasann 05-29-2009 02:57 PM

without vBSEO not working for me.

IdanB 05-29-2009 03:05 PM

Quote:

Originally Posted by Hasann (Post 1819595)
without vBSEO not working for me.

version 1.0.2 ?
Can you give more information as to what not working ?
Errors showing on page ? empty links ?

EDIT: also, have you checked it with default skin ?
I will gladly debug this to support other unforseen factors, but i'll need as much information as possible.
Could you please add screenshot that shows problem ?

Hasann 05-29-2009 03:20 PM

sure I've installed version 1.0.2 on default skin and if I select turkish language it shows nothing.

http://img12.imageshack.us/img12/5281/altlastpost.jpg

IdanB 05-29-2009 03:27 PM

I see.
Well few things:
1. minor: align to left, it's minor issue - will be fixed on next rev.
2. i see it detects avatar & nicks correctly, with exceptions of 2 users. Can you please paste their nicks, so i'll see what chars the regexp not catching. Is it English / Arab chars ?
3. As to the "Post Time: N/A" is it using non mm-dd-yyyy format on forum ? non english numbers ?

Any chance you can paste the html as seen on your forum, while mod is disabled ? (specific the html block inside the last post cell)
i want to match the regular expression in mod to ones you have, and understand what's different between what you have & what i have in mine.

EDIT2: As long as i can find in html some anchor in english (some html char / tag) that can be used to grabbing, this issue can be fixed in a common way to all languages. About fact turkish language showing nothing - this is due to regular expression. if we fail to find some common tags to use as refrence to fetch fields, this might require version specific code, as i'm not sure it's possible to make turkish & english regexp code that cover all cases...

Hasann 05-29-2009 03:38 PM

Quote:

Originally Posted by IdanB (Post 1819614)
I see.
Well few things:
1. minor: align to left, it's minor issue - will be fixed on next rev.
2. i see it detects avatar & nicks correctly, with exceptions of 2 users. Can you please paste their nicks, so i'll see what chars the regexp not catching. Is it English / Arab chars ?
3. As to the "Post Time: N/A" is it using non mm-dd-yyyy format on forum ? non english numbers ?

Any chance you can paste the html as seen on your forum, while mod is disabled ? (specific the html block inside the last post cell)
i want to match the regular expression in mod to ones you have, and understand what's different between what you have & what i have in mine.

2. no it is Turkish chars.
3. Im using tr_TR on Linux with %d %B %Y format on my forum

here is the html block inside the last post cell while mod is disabled.

HTML Code:

<td class="alt2" width="36%">
<div class="smallfont" align="left">
        <div>
                <span style="white-space:nowrap">
                <img class="inlineimg" src="http://www.vbulletin-turkey.com/forum/images/icons/document.png" alt="" border="0" />
               
                <a href="showthread.php?goto=newpost&amp;t=4240" style="white-space:nowrap" title=" 'Css dosyası' Konusundaki birinci okunmamış Mesaja git"><strong>Css dosyası</strong></a></span>
        </div>
        <div style="white-space:nowrap; float:left">
                G?nderen: <a href="member.php?find=lastposter&amp;f=9" rel="nofollow">Hasann</a>
        </div>
        <div align="right" style="white-space:nowrap">
                29 Mayıs 2009 <span class="time">17:26</span>
                <a href="showthread.php?p=30473#post30473"><img class="inlineimg" src="images/turkce/buttons/lastpost.gif" alt="son yazılan Mesajı g?ster" border="0" /></a>
        </div>
</div>
</td>


IdanB 05-29-2009 03:50 PM

about different non-default date - it's a "pitfall" i've indeed neglected - that will be fixed on next rev.
About turkish chars, lemme investiage this for some "work-around" solution, i might need your help too. I've sent yu a pm - if you have msn, that would help.

I'll update on any progress.

IdanB 05-29-2009 05:21 PM

Update:
Till next version uploaded, i've updated "Known Bugs" sections - please be aware of them:
1. This mod supports english chars only.
2. The date format currently supported is only "m-d-Y".
3. vbSEO has problem with some of the nicks - sometimes shows as '' & link to profile with "a".
4. Time Diff sometimes shows incorrect negative value - still under check to locate cause.

EDIT:
Bug #1 - is under work but will take rather time to resolve (as this affect regular expressins) & every different language might have different "symptoms-bugs" . (a fix that will support all languages might be matter of days/weeks)
Bug #2 - is under work, i hope a fix is hours/days away.
Bugs #3 & #4 - currently being investigated.

Seems alot of factors that users has control of inside admincp can cause conflicts/pitfalls thats needs consideration in code.
Since i want as frequent updates as possible (but not too much, not to trouble you to keep re-download it), i'll release next revision when i have several bugs fixed.

IdanB 05-30-2009 09:24 AM

version 1.0.3 was uploaded.
See changelog for complete bugs fixed.
I've also uploaded recent screenshot showing how it looks.

The most critical issue currently fixed in this version is the date / time string - now supporting any format input by user on admincp. The chars supported are : "d", "m", "n", "D", "F", "M", "Y", "y", "h", "H", "g", "G", "i", "s", "a", "A".

About vbSEO, i know few people with it, so i'll closely debug this with them, hoping that next version should be vbSEO bugs free (should any of those bugs in there still exists)

ArnyVee 05-30-2009 12:04 PM

Very cool hack :)

Going to wait until most of the vBSEO bugs are fixed, but definitely installing this one :up:

goxy63 05-30-2009 05:58 PM

Cool mod but as I can see not supporting other languages but english

Cant wait that other languages will be supported

Rated

IdanB 05-30-2009 06:42 PM

EDIT2:

I have the solution !!! i dont understand why i didnt see it earlier :p
Expect v1.1.0 in next 30 minutes

EDIT3: will be uploaded tomorrow night, need to sleep. Waking to work in 5h.

dancue 05-30-2009 09:53 PM

1 Attachment(s)
I'm not seeing any time data under the user info.

Before and after images attached.

whitetigergrowl 05-31-2009 01:04 AM

'Last Post' doesn't tell the members anything about what the post is about. Any way to better fix that?

IdanB 05-31-2009 04:07 AM

Quote:

Originally Posted by whitetigergrowl (Post 1820366)
'Last Post' doesn't tell the members anything about what the post is about. Any way to better fix that?

Original request for mod was it be without full title so didnt add it.
Indeed fair point - i'll add it on as feature into admincp so this can be controlled.
I'm Currently at work, when i'll get back home tonight i'll upload v.1.1.0 (including this feature).

IdanB 05-31-2009 04:09 AM

Quote:

Originally Posted by dancue (Post 1820314)
I'm not seeing any time data under the user info.

Before and after images attached.

The fixed version that will be uploaded tonight will resolve all of these, as i'm gonna to re-code entire mod in a different approach that has zero possible errors.

dancue 05-31-2009 04:12 AM

sounds good. can't wait!

ArnyVee 05-31-2009 10:07 AM

Quote:

Originally Posted by IdanB (Post 1820457)
The fixed version that will be uploaded tonight will resolve all of these, as i'm gonna to re-code entire mod in a different approach that has zero possible errors.

Sounds good Idan! Got my eye on this one! :)

Darkgardevoir 06-01-2009 07:16 AM

this is'nt working

IdanB 06-01-2009 05:12 PM

v1.1.0 been postponed to weekend. There is some issue that needs resolving + i would like to better test it with vbSEO, and i rather make it 100% working & upload a working ver than upload something that will again work for some & for others will not.
Sadly this week been for me much longer hours @ work than i estimated. I'm too tired to debug this now. So this mod will be updated on the weekend (Saturday probably).

IdanB 06-05-2009 01:05 PM

version 1.1.0 uploaded - code been through major face-up, rewritten it - the entire concept was changed. It should now support any language & fix all the known bugs !

romolus 06-05-2009 01:58 PM

Hy, i have einstalled this mod.

but it is not working on the forum home.
on the Forum display it is ok!

i activated the forum home and an Error message is coming:

Pleas help.
my site: www.terramystik.lu

Thank's

Code:

Datenbankfehler in vBulletin 3.8.2:

Invalid SQL:
SELECT dateline, userid FROM `customavatar` WHERE userid =;

MySQL-Fehler  : Fehler in der SQL-Syntax. Bitte die korrekte Syntax im Handbuch nachschlagen bei '' in Zeile 1
Fehler-Nr.    : 1064
Fehler-Zeit  : Friday, 05.06.2009 @ 16:57:21
Datum        : Friday, 05.06.2009 @ 16:57:21
Skript        : http://www.terramystik.lu/index.php
Referrer      : http://www.terramystik.lu/forumdisplay.php?f=1
IP-Adresse    : 87.240.211.83
Benutzername  : Heliopolis
Klassenname  : vB_Database
MySQL-Version : 5.0.32-Debian_7etch6


troll2 06-05-2009 02:23 PM

Installed latest version. Picture does not show on forum home or forum display.

IdanB 06-05-2009 02:35 PM

Quote:

Originally Posted by romolus (Post 1823909)
but it is not working on the forum home.
on the Forum display it is ok!

Looking into it now.

EDIT: found the problem !!
The sub category on your forums called "LEHRE DES VERBORGENEN" has forum with last post from user with nick of "Kangiska" that user was deleted from your database. As result when i query for his userid i get no user_id which used later on for given query you've qouted.
My assumption was that any user shown on last post exsits on db & not deleted. (Prooved wrong)

EDIT2: Fixed it in code. Once other bug reported will be fixed i'll upload v1.1.1 that should fix the issue for you.

IdanB 06-05-2009 02:49 PM

Quote:

Originally Posted by troll2 (Post 1823927)
Installed latest version. Picture does not show on forum home or forum display.

can you provide plese with screenshot, or better with the image url loaded ?
(right clickj on image, properties & copy paste the "address" shown)

troll2 06-05-2009 02:59 PM

Its a site under development. http://hmsplan.com/forum.php ...it looks like a conflict with some another forumbit code??

IdanB 06-05-2009 03:05 PM

Quote:

Originally Posted by troll2 (Post 1823957)
Its a site under development. http://hmsplan.com/forum.php ...it looks like a conflict with some another forumbit code??

might be conflict with other mod, only way to be sure of that is disable the rest & see if this still remains.
Does this show "broken image" where the avatar supposed to be ? as i think might be no image tag at all, and that might means some other mod uses var named $GLOBALS[avatar_img].
Will await on your reply, if when other mods disabled this works, i'll change var name to be unique for this mod, and i'll upload v1.1.1.

EDIT: if possible upload screenshot, i want to be sure if it's adds broken img tag or non at all.


All times are GMT. The time now is 07:13 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01485 seconds
  • Memory Usage 1,876KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_html_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete