The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How to add the time in blog view?

Page 1 of 2 1, 2  Next

View previous topic View next topic Go down

Solved How to add the time in blog view?

Post by Luffy on July 16th 2017, 11:50 pm

Hello everyone,

So i am trying to add the time of which the posts were made in the topic preview within the category. The problem is that the categories are blogs and the date is there but the time is not. If possible, i would like the time to be displayed in the topics preview within the blog category and in the blog posts and comments as well.

Forum Version: Phpbb3
Forum link: will be sent if needed.

Thanks a lot in advance!





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Justice™ on July 17th 2017, 7:10 pm

Hi,

By default, the date is not shown in the blog posts. The only option to show the date would be to add the date to the post when posting it. Basically if you post a topic with this content:
Code:
Content
and it's 08:35, then, just before you post the topic, my code would transform the post content to something like this:
Code:
Content<ddated>08:35</ddated>
The
Code:
<ddated>08:35</ddated>
would be hidden when someone looks at the topic. The script would get the data and insert it in the blog list. Also note that the old topics would not have the date in them and there's nothing anyone can do about it(maybe hack FM's database and get the date from there. Just kidding Razz ). If this sounds good to you, let me know and I'll start working on the code.
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: How to add the time in blog view?

Post by SLGray on July 17th 2017, 8:08 pm

Also there is a current time button in the editor.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

avatar
SLGray
Administrator
Administrator

Male Posts : 40197
Reputation : 2716
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Justice™ on July 17th 2017, 8:22 pm

SLGray wrote:Also there is a current time button in the editor.
Good to know. I'll be using JS's Date() for the code, so no need for that button. Cool
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 18th 2017, 8:10 am

@Wolfuryo yes please that would be amazing thank you.
@SLGray, i know that but i cannot make it show the time someone posted using that button because members have to press it before posting.. But thanks a lot.





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 19th 2017, 10:57 am

Bump.





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Justice™ on July 19th 2017, 1:07 pm

@Luffy, I'm on vacation with my family for about a week so I won't be able to assist you with this till next week. Please bump this topic from time to time so I won't forget about it and it won't be garbaged.
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 19th 2017, 2:27 pm

Wolfuryo wrote:@Luffy, I'm on vacation with my family for about a week so I won't be able to assist you with this till next week. Please bump this topic from time to time so I won't forget about it and it won't be garbaged.
Okay @Wolfuryo, will do so! Smile Thanks a lot and enjoy your vacation.





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 20th 2017, 10:59 pm

Bump.





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Van-Helsing on July 20th 2017, 11:15 pm

Hello @Luffy,
Have you check if there is a php variable in the default template? You can identify php variable from symbols {} i.e php variables looks like this {BLOG_POST_TIME}. Please check in this template topics_blog_box if there are the date fields code:

Code:

         <div class="blog_cal-border">
            <div class="blog_cal-content">
               <span class="blog_cal-{topics_blog_box.row.FIRST_POST_DMY_CLASS0}">{topics_blog_box.row.FIRST_POST_DMY_VALUE0}</span>
               <span class="blog_cal-{topics_blog_box.row.FIRST_POST_DMY_CLASS1}">{topics_blog_box.row.FIRST_POST_DMY_VALUE1}</span>
               <span class="blog_cal-{topics_blog_box.row.FIRST_POST_DMY_CLASS2}">{topics_blog_box.row.FIRST_POST_DMY_VALUE2}</span>
            </div>
         </div>
avatar
Van-Helsing
Hyperactive

Male Posts : 2306
Reputation : 90
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 21st 2017, 10:39 pm

I already tried all possible ways for that to work but they don't work. They should have the time displaying there.. Sad





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Van-Helsing on July 21st 2017, 10:58 pm

Hello @Luffy,
Yes as I was investigated last night this issue but I didn't find any php variables related with time displaying, also I didn't find the similar template like viewtopic_body for blog posts. I dont know if it is the same template with posts or if the blogs using different template for blog posts and is not accessible to us. It is better to ask someone from tech team about this.
avatar
Van-Helsing
Hyperactive

Male Posts : 2306
Reputation : 90
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 24th 2017, 2:30 am

Bump





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Justice™ on July 24th 2017, 7:24 am

Hi,

@Luffy, the code was placed on your forum. I'm not going to put the code here because it will only work on Luffy's forum.
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 25th 2017, 8:41 am

@Wolfuryo this code only displays the time on your post and the post below your post.
I changed the after to before i there so i can style the time where i want it to be.

We have to see what's going on because this doesn't appear on every blog topic.





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Van-Helsing on July 25th 2017, 10:22 pm

Ηello @Luffy,
Have you setup all blogs exactly with the same configuration?
avatar
Van-Helsing
Hyperactive

Male Posts : 2306
Reputation : 90
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 25th 2017, 11:25 pm

Yes i have..





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Van-Helsing on July 25th 2017, 11:45 pm

scratch Very strange that means your code is not working correct, have you check your Js if it uses a random/randomize functions? Normally it mustn't shows different settings per blog. Have you setup your code to work on pre-selected blog-categories? Can you post your code here to check it?
avatar
Van-Helsing
Hyperactive

Male Posts : 2306
Reputation : 90
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 25th 2017, 11:59 pm

@Wolfuryo made the code. He didn't want to share the code because it only works on my forum.. I am not sure what to do.. :O





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Justice™ on July 26th 2017, 6:49 pm

Hi,

@Luffy, the code only works for topics that are made after the code was installed. It's not possible to show the time everywhere, because there is no place on the forum where you can see that time.

@Van-Helsing, this is the code that deals with getting the time and placing it where it's supposed to be:
Code:
$(document).ready(function(){
 
  /*Code by Wolfuryo. Usage of this code without this notice will result in the destruction of the website using the code*/
 
  var reg = /f\d+/;
  var pth = location.pathname;
 
  if( !reg.test(pth) || !$(".blog").length ) return;
    var ddata = $("ddata"),
        len = ddata.length,
        i = 0,
        bl_day = $(".blog_cal-year");
 
  for(i;i<len;i++){
    bl_day.eq(i+1).after('<span class="timeTime" id="bl_time"> - ' + ddata.eq(i).text() + '</span>');
  }
});

On Luffy's forum, there is a custom page that deals with topic posting in blogs. I have edited it a bit as well to add the date at the beginning of every blog topic..
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Van-Helsing on July 26th 2017, 10:04 pm

Hello @Luffy,
Can you post your forum link to try debug your javascript?
avatar
Van-Helsing
Hyperactive

Male Posts : 2306
Reputation : 90
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 27th 2017, 10:52 am

My forum link is https://inforumgr.com

@Wolfuryo the code does not work for /f71-forum
I thought the code would word as you said so i checked some new topics on that category but it doesn't display the time anywhere..





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Justice™ on July 27th 2017, 4:17 pm

Hi,

I have made edits to the page that you use for blog posting(https://www.inforumgr.com/h4-page). When I checked, the edits were not there. I don't know why that happened, but it should be solved now.
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 28th 2017, 12:55 am

@Wolfuryo thanks a lot. One last thing. If for example it's 1 o'clock and 3 minutes the display time shows as 1:3 instead of 01:03. Can we fix that please. I am seeing an example now that says 21:1 instead of 21:01. http://prntscr.com/g16tl5





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Justice™ on July 28th 2017, 6:57 am

It should be solved now, @Luffy.
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 28th 2017, 12:12 pm

@Wolfuryo, the edits you did for /h4-page is now the problem because now we cannot make any new posts now..





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Justice™ on July 28th 2017, 12:20 pm

Hi again,

The problem should be fixed now.
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 29th 2017, 11:52 am

@Wolfuryo this is not solved yet as my members tell me that they try to make some posts and some times it's ok and some other it shows the issue again.





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Justice™ on July 29th 2017, 12:52 pm

All of the topics in blogs are posted through /h4-page? If so, there shouldn't be any problem.
avatar
Justice™
Forumember

Posts : 514
Reputation : 117
Language : Romanian and English

http://board.realmsn.com

Back to top Go down

Solved Re: How to add the time in blog view?

Post by Luffy on July 30th 2017, 12:01 am

No for each page we have different blog. I had:
/h4-page which is for Greece News, /h5-page which is for World News, /h6-page for Sport News and so on. All the hmtl pages starting from /h4 and up are all new topic forms. Now though i have them all directing to /h1-page to avoid all those pages.





avatar
Luffy
Manager
Manager

Male Posts : 4788
Reputation : 484
Language : Greek, English
Location : Greece

http://vibes.forumotion.com/

Back to top Go down

Page 1 of 2 1, 2  Next

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum