Page 1 of 2

I can't believe it

Posted: Tue Jul 05, 2005 1:32 pm
by Capmaster
A member requested that I add a column to Viewforum that shows the topic starter's username, the date, and the time a topic was started.

I thought "That'll be easy. Heck, there's even a hack to add random lizards running around my forum, so this'll be a cinch, seeing as how it is a useful feature."

:roll: :roll: :roll: :roll:

No such luck. The closest I could find was a hack that adds the topic starter's name underneath the topic title, but nothing that adds a column.

I'm looking for something along the same lines as the index hack that adds forum views. Simple - just a column.

This site has added it - apparently he wrote his own hack (the column entitled "Author"):

http://www.videohelp.com/forum/viewforum.php?f=10

Any ideas how I can add this?

Posted: Tue Jul 05, 2005 4:13 pm
by DashSpeed
Actually, you might want to check out viewforum.php and especially includes/functions_topic_list.php for the variables.

Edit the looks of the list in template/subsilver/topics_list_box.tpl

Here's the fix:

Code: Select all

IN template/subsilver/topics_list_box.tpl FIND:
<td class="row3" align="center" valign="middle"><span class="name">{topics_list_box.row.TOPIC_AUTHOR}</span></td>

INLINE, FIND:
{topics_list_box.row.TOPIC_AUTHOR}

AFTER, ADD:
<br>{topics_list_box.row.FIRST_POST_TIME}
That's it. Final code would be:

Code: Select all

<td class="row3" align="center" valign="middle"><span class="name">{topics_list_box.row.TOPIC_AUTHOR}<br>{topics_list_box.row.FIRST_POST_TIME}</span></td>
If you want the name under the date, just swap the 2 {topics_list...}

Posted: Tue Jul 05, 2005 4:27 pm
by Capmaster
DashSpeed wrote: Actually, you might want to check out viewforum.php and especially includes/functions_topic_list.php for the variables.

Edit the looks of the list in template/subsilver/topics_list_box.tpl

I don't really understand what you want though, the only difference I see between the forum you've shown and an original phpbb installation is the fact that the Author column has the date the topic was started?
I apologize for the confusion - typos on my part. I don't need the column itself - just the added info.

An original phpbb installation has no "author" date/time info in the column viewforum. The forum I linked to shows that info as having been added by the admin.

I'm just after a hack that adds the info :wink:

Posted: Tue Jul 05, 2005 4:30 pm
by DashSpeed
I edited my post, check it out again, sorry :P

Posted: Tue Jul 05, 2005 5:22 pm
by Capmaster
DashSpeed wrote: I edited my post, check it out again, sorry :P
Thank you, kind sir! :wink:

God I love phpBB!! :D 8)

Posted: Tue Jul 05, 2005 5:23 pm
by Capmaster
edit - major board issue when I posted

Posted: Tue Jul 05, 2005 5:23 pm
by Capmaster
edit - major board issue when I posted

Posted: Tue Jul 05, 2005 6:40 pm
by Capmaster
The final affected code in topics_list_box.tpl looks like:
<td class="row2" align="center" valign="middle"><span class="postdetails">{topics_list_box.row.FIRST_POST_TIME}<br>{topics_list_box.row.VIEWS}</span></td>


I wanted the name under the date and time.

But there's no change whatsoever:

Image

What did I miss doing? :?

Posted: Tue Jul 05, 2005 7:12 pm
by Blankety Blank Man
did you save the file and upload it?
did you edit the template that you are using to check the difference?

that image doesn't look like subSilver. did you edit subSilver or another template?



sometimes it's those little things that makes the difference. like yesterday when i tried to print a Dark Ages: Mage character sheet while my printer was OFF ;)

Posted: Tue Jul 05, 2005 7:29 pm
by Capmaster
Blankety Blank Man wrote: did you save the file and upload it?
did you edit the template that you are using to check the difference?

that image doesn't look like subSilver. did you edit subSilver or another template?



sometimes it's those little things that makes the difference. like yesterday when i tried to print a Dark Ages: Mage character sheet while my printer was OFF ;)

Upload - yes, and a fresh page load to check it in the forum.

Yes I have edited the template for forum text colors, mod and admin logged in name colors, etc.

The only template I'm running is subsilver. That image looks bad probably because of the jpegging. The real text color is maroon - the color I'm using for the admin color instead of the obnoxious bright orange ;)
like yesterday when i tried to print a Dark Ages: Mage character sheet while my printer was OFF
:lol: :o

I don't dare laugh at you. If I had a dollar for every time I did something like that .... 8O

Posted: Tue Jul 05, 2005 11:18 pm
by DashSpeed
You didn't modify the right line...

Posted: Wed Jul 06, 2005 12:20 am
by Capmaster
DashSpeed wrote: You didn't modify the right line...
:roll: That'll teach me to do this when I'm so tired I'm seeing double :oops:

I'm off now to make the correct changes :D

Posted: Wed Jul 06, 2005 12:38 am
by Capmaster
Redid it with the two in opposite positions. The second attempt I changed it just as you had listed. Nothing. No date, no time there.

Is there another file besides the .tpl file where I have to call out the variable? Like in constants.php?

I'm fairly new at this so I'm just guessing, but it had no effect whatsoever, so I'm guessing I need to do something else to it.

My board rev. is 2.0.14 with the security patches from 2.0.15, if that matters.

Posted: Wed Jul 06, 2005 12:41 am
by DKing
Is the variable FIRST_POST_TIME defined in the php file? If not, you need to do that (sorry, too busy to write anything up for you, but I would if I had time! :oops:)

Otherwise, either you coded wrong or you aren't saving and uploading and such.

Or, you might try clearning your browser cache, as that has been my problem for a long time. When I have errors, it caches them. So I fix them correctly, and it doesn't change because it is cached.

-DKing

Posted: Wed Jul 06, 2005 4:00 am
by DashSpeed
DKing wrote: Is the variable FIRST_POST_TIME defined in the php file? If not, you need to do that (sorry, too busy to write anything up for you, but I would if I had time! :oops:)

Otherwise, either you coded wrong or you aren't saving and uploading and such.

Or, you might try clearning your browser cache, as that has been my problem for a long time. When I have errors, it caches them. So I fix them correctly, and it doesn't change because it is cached.

-DKing

FIRST_POST_TIME is present in includes/functions_topic_list.php
I suggest you check that file and do a search for "FIRST_POST_TIME" (no quotes).

And I've also tested that code on my own forums and it works...