Topic Author And Topic Age

Started by Rohan_, June 25, 2009, 03:21:48 PM

Previous topic - Next topic

Rohan_

Hi Allzz ..


i saw this type of topics in Vb and i likes it and i want this type of messageindex on my smf ... i want the topic author's name and topic age after every topic .. i am also posting a image for you see this and please tell me is this possible ..

he it is


in this image u can see the poster name and the topic age after every topic :) i want this
Proud To Be An Indian

Rohan_

Proud To Be An Indian

Arantor

First of all, please do not bump within 24 hours of your post; we are all volunteers here and sometimes it does take longer to get to an individual query.

Most of what you want can be achieved with this mod.

Adjusting it to include the thread's age shouldn't be a problem - there are likely to be details in the mod's own thread.

Rohan_

hey i dont want the profile link on the username appear after a topic after using this mod .. how to do this ?
Proud To Be An Indian

Arantor

You are normally likely to get better support in the mod's thread since it will be in the mod that it needs to be changed.

Though since this is quite a small change, I'll answer it here.

In the modified BoardIndex.template.php for your theme (or default/BoardIndex.template.php otherwise), look for:
<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '<br />', $txt['cby'], ' <b>', $topic['first_post']['member']['link'],  '</b></small>

Change it to:
<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '<br />', $txt['cby'], ' <b>', $topic['first_post']['member']['name'],  '</b></small>

Rohan_

okay .. anyway to add topic age ?? please if possible it will really appreciated .. mainly i need that
Proud To Be An Indian

Arantor

That one you would have to ask in the mod's thread, it's actually not a small change. If nothing else, do you round up or down?

For example, a topic is exactly 1 hour 30 minutes old - was it posted "an hour ago" or "2 hours ago"?

Rohan_

no no no .. i dont want the time i want like this >

like i posted a topic so i want after a topic this > Rohan_ - Today , Rohan_ - 1 Day Old , Rohan_ - 2 days old , 3 days old 4 days old .

i want like this . i want the age in days :) i hope now u can understand what i want
Proud To Be An Indian

Arantor

That's my point - I was trying to ascertain what you wanted. In any case, the mod's own topic is still the best place to ask because the mod's author reads that thread.

Rohan_

i dnt know much about that you guys are the boss here i asked for help here and u helping me .. please forward my this problem wherever u think its right and helpful .. now its your heading to solve this topic :) . thanks a lot
Proud To Be An Indian

Arantor

I'm no boss here, I'm just someone who posts far too much and frequently doesn't know what I'm talking about.

I'm just pointing out that since there's a mod that does half of what you want, it would probably be quicker to get an answer on modifying that mod to suit exactly what you want there - I don't know the mod at all, I hadn't even seen it until yesterday when I looked (quickly) at its source.

Rohan_

please find a way :D i also posted a pic in my first post see then i want like that :D .. please find a way to do that :D .. you are the boss for me 8)
Proud To Be An Indian

Arantor

The thing is, this is not as easy as the fix I mentioned above - that's a one line change. The change you're asking for is not a one line change. It's definitely more complex.

Seriously, post it in the mod's own topic, then the mod author himself can modify this for you then release it to everyone as an updated version of his mod.

Rohan_

Proud To Be An Indian

Arantor

Hello, did you manage to get this sorted?

Rohan_

no ... no one helping me there :( they said to wait me and now they saying that they dont have time .. post ur request in coding section  :'( :( :-X
Proud To Be An Indian

Arantor

If you can post your current theme's BoardIndex.template.php file I'll do it. Generally yes it should be done by the mod author but you've been waiting several days so post it here and I'll sort it for you.

Rohan_

#17
which board index ?

i attached boardindex.template of the current theme that i am using not of default .

and one more thing that currently i have applied a mod of topic starter name after topic name (Vb style Topic Starter ) so just add topic age after that ..

i think u need messageindex.template ...... m i right ??
Proud To Be An Indian

Arantor

Sorry, yes, it was MessageIndex.template.php I meant, not BoardIndex.template.php.

Rohan_

here is the default messageindex.template file :)

please do it for me :D
Proud To Be An Indian

sAce

sorry to disappoint you rohan_ , but aranator is right this is a complex  modification you are asking for,

i looked into it and and found it requires a lot of work, not just some 1-2 line modification

but have patience it will be done sometime :P , i will try to make it work once i understand how :P

have faith , :D

thank you

Aleksi "Lex" Kilpinen

Moved this over to "SMF Coding Discussion" where this may get better responses on the issue at hand.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

sAce


Rohan_

please do it as fast as possible :)

thank u all
Proud To Be An Indian

Rohan_

Proud To Be An Indian

Arantor

Let me clarify: this means several modifications to core code, and between trying to find a job and repeated hospital visits, I really haven't had time to dig into this. As soon as I am able I will attempt it, but my personal life is making this somewhat difficult at present (you may have noticed that my post rate has dropped)

Rohan_

Proud To Be An Indian

Sabre™

Quote from: Arantor on June 27, 2009, 07:46:02 AM
.... I'm just someone who posts far too much and frequently doesn't know what I'm talking about.

LOL
Best line I've read in ages! lol

Sorry, off topic :D
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Aleksi "Lex" Kilpinen

Quote from: Sabre™ on July 08, 2009, 08:06:09 AM
Quote from: Arantor on June 27, 2009, 07:46:02 AM
.... I'm just someone who posts far too much and frequently doesn't know what I'm talking about.

LOL
Best line I've read in ages! lol

Sorry, off topic :D
Actually, how did I miss that? :D Hilarious. ;)
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Rohan_

guys we will do jokes after work :( why dont someody help me :( this is the SMF owners site  .. where is the creator of smf .. they can solve it in seconds
Proud To Be An Indian

Aleksi "Lex" Kilpinen

Sorry to say Rohan_ but if you can't do something yourself, you should at least have patience to allow others the time they need - unless you want to pay for the work.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Bulakbol

Try this one. Paste this code in your MessageIndex.template.php. Let's see if that's the one you are looking for. This is for the default theme.
Code (find) Select
<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
Code (replace) Select
<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>';
$today = @getdate(time());
echo '<div style="font-size: 10px; padding: 2px;">', $topic['first_post']['member']['name'], ' - ', floor(($today[0] - $topic['first_post']['timestamp']) / 86400 ), ' days</div>
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

sAce

thank you bulakbol ,

he wanted "days ago"

so for that replace " days " from the end of the code with " ', $txt['days_ago'], ' " and
add " $txt['days_ago'] = 'Days ago.';  " in modifications.english.php

Rohan_

Can u please make a exact code for me ?? i want days old
Proud To Be An Indian

Rohan_

hey i got this

Parse error: syntax error, unexpected '}' in .../Themes/default/MessageIndex.template.php on line 243

234:
235: // Is this topic new? (assuming they are logged in!)
236: if ($topic['new'] && $context['user']['is_logged'])
237: echo '
238: <a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" /></a>';
239:
240:                   echo '
241: <small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>';
242:                   $today = @getdate(time());

243:                   echo '<div style="font-size: 10px; padding: 2px;">', $topic['first_post']['member']['name'], ' - ', floor(($today[0] - $topic['first_post']['timestamp']) / 86400 }, ' days</div>

244: </td>
245: <td class="windowbg' , $topic['is_sticky'] ? '3' : '' , '" valign="middle" width="4%" align="center">
246: ', $topic['replies'], '
247: </td>
Proud To Be An Indian

Arantor

Change the } on line 243 to a ) and try it again.

Rohan_

woww how easily Bulakbol solved this problem .. anyways there is a problem the days are exactly not matching with the real date of the topic when it posted .. there is a difference of 1 day .. i just have posted a topic and it showing 1 days old ... and in some topics it showing 0 days old i want Today not 0 days old
Proud To Be An Indian

Rohan_

see this pic the first topic posted 10 mins ago and it showing it 1 days ago i want to see it Today .. and the other topics are 23 days old and it showing them 22 days ago .. there is a problem of 1 day please solve it

any topic i am posting now my site showing them 1 days old :(
Proud To Be An Indian

Arantor

This is why Bulakbol is on the team and I am not. As I said to you earlier on, I frequently don't know what I'm talking about.

As for this, try replacing:

<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>';
$today = @getdate(time());
echo '<div style="font-size: 10px; padding: 2px;">', $topic['first_post']['member']['name'], ' - ', floor(($today[0] - $topic['first_post']['timestamp']) / 86400 ), ' days</div>


With:

<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>';
$today = @getdate(time());
$days = ceil(($today[0] - $topic['first_post']['timestamp']) / 86400 );
if($days <= 1) {
echo '<div style="font-size: 10px; padding: 2px;">', $topic['first_post']['member']['name'], ' - <b>Today</b></div>';
} else {
echo '<div style="font-size: 10px; padding: 2px;">', $topic['first_post']['member']['name'], ' - ', $days, ' days</div>';
}
echo '


It probably won't work but worth a try anyway.

Rohan_

#39
woo hoooo .. i dont think that its true that u dont know what u are talking about :D u have solved it buddy .. it is solved .. i am really very happy because is solved after a long time .. thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks  . A TON . all of u  .. thanks from heart to all that helped me and a special thanks to Bulakbol to giving us the idea:) thanx again
Proud To Be An Indian

Shark-Time

Wow thank you every one and especially Rohan for redirecting me to his Post...thanks you Every one...



Providing Cheapest Offshore Hosting as low as 5$/year.
MoneyBookers | AlertPay
Pm Me

Rohan_

Proud To Be An Indian

Rohan_

#42
hi .. i got a problem .. currently this code shows a topic posted Today for 24 hours .. so what i want is when a topic is posted on 11:59PM so it must become 1 day old at 12:00AM .. i hope u understand .. i want the Today or 1 day , 2 day old etc based on the date ..  .. clearly currently all 1 days old topics also looks Today . i cant see any topic 1 days old .. there is only Today or 2 days but no 1 day
Proud To Be An Indian

Shark-Time

yup i think it should be yesterday instead of 1day old..


Providing Cheapest Offshore Hosting as low as 5$/year.
MoneyBookers | AlertPay
Pm Me

Advertisement: