|
Joined: Feb 2001
Posts: 108
Member
|
Member
Joined: Feb 2001
Posts: 108 |
Perhaps GoTo or any of you great coders can help me out here.
This is in regards to Slash UBB for 5.x series (running 5.47e).
Slash UBB allows you to create Headlines if you don't want a summary and lists those headlines as so:
Headline 1 Headline 2 Headline 3 Headline 4
Up to the # you set in the configuration. You can also show the date, so it lists it as:
Headline 1, June 9, 2001 Headline 2, June 9, 2001 Headline 3, June 9, 2001 Headling 4, June 9, 2001
Not what I want. Anyone know how I could get it to list like so:
June 9, 2001
Headline 1 Headline 2
June 5, 2001
Headline 4 Headline 5
I've played around with this for sometime and I can't figure it out. I can add the $StartDate and/or $TheDate but because the Slash UBB adds it in a loop (until it reaches your # of headlines you set) so it lists it like:
June 9, 2001 Headline 1 June 9, 2001 Headline 2
etc, etc.
I want it to post the date and organize the headlines that are posted for that date for each day.
Hope that isn't too confusing. I can post the code if you need it.
p2k!
|
|
|
|
Joined: May 2001
Posts: 6,708
Member
|
Member
Joined: May 2001
Posts: 6,708 |
Well of course you'll need to edit the code so it shows like that..I havent installed that hack before but does it use a new file? If it does that what you need to edit.
|
|
|
|
Joined: Feb 2001
Posts: 108
Member
|
Member
Joined: Feb 2001
Posts: 108 |
Of course it comes with a file and of course I've been playing with it (thus the reason I'm pulling out my hair). I can't get it to post how I'd like. June 9, 2001 All headlines posted on June 9, 2001 listed here. June 8, 2001 All headlines posted on June 8, 2001 listed here. etc, etc, etc. Enjoy for anyone who can help me. ptwok
|
|
|
|
Joined: Apr 2001
Posts: 57
Member
|
Member
Joined: Apr 2001
Posts: 57 |
Without really looking at the code, let me give you an idea about how to do this. In the first part of the loop, make a new variable that is set to the current date in the loop. Then when you are printing out the headline/date stuff, compare the headline date to your newly created date variable. If it is the same, don't print the date. If it's different, then print out the date and update the variable you created to the new date.
[ June 10, 2001 01:02 PM: Message edited by: treszoks ]
|
|
|
|
Joined: Feb 2001
Posts: 108
Member
|
Member
Joined: Feb 2001
Posts: 108 |
I realize that too and one of the reasons for posting the code was to have someone point me in the right direction as to where to add this and what to add. I've narrowed it down to this part of the code, but as to what to write *shrugs* I have no idea.
|
|
|
|
Joined: Apr 2001
Posts: 57
Member
|
Member
Joined: Apr 2001
Posts: 57 |
So it looks like $threadheader[8] has both the headline and date in it? Do a split on it at the comma.
($headline,$date,$year) = split(/,/,$threadheader[8]);
Then combine the date year like so: $the_date="$date, $year";
Now just add in an 'if' statement before $PAGE .= qq(...); that checks whether or not to include the date in $threadheader[8]. If it doesn't need it, set $threadheader[8]=$headline; else leave it alone with the date included.
Hope that helps getting you started.
|
|
|
|
Joined: May 2001
Posts: 6,708
Member
|
Member
Joined: May 2001
Posts: 6,708 |
I would say you need to remove a sub or section about "hedline $ThisDate" section and replace it with what you want.
|
|
|
|
Joined: Feb 2001
Posts: 108
Member
|
Member
Joined: Feb 2001
Posts: 108 |
Thanks for the help but I've pretty much given up on it. It's far too confusing for me to grasp and all I'm getting is frustration and blank screens. The headlines will just have to remain without the dates but at least the summary of them has it.
p2k
|
|
|
|
Joined: Apr 2001
Posts: 57
Member
|
Member
Joined: Apr 2001
Posts: 57 |
I hate to see someone give up, so... without having a running copy I can't test this, but try it: Place the following code right above the "$PAGE .= qq($BorderTop......etc" [ June 11, 2001 05:36 PM: Message edited by: treszoks ]
|
|
|
|
Joined: Feb 2001
Posts: 108
Member
|
Member
Joined: Feb 2001
Posts: 108 |
Sorry for the late reply, but it didn't work. All it did was produce this: , headline 1 headline 2 headline 3 headline 4 Didn't even break up the headlines for each new day with a , just put a , at the top of the listing, nothing more. p2k
|
|
|
|
Joined: May 2001
Posts: 6,708
Member
|
Member
Joined: May 2001
Posts: 6,708 |
Hmm...I couldn't figure out how to do it either..Sorry.
|
|
|
|
Joined: Apr 2001
Posts: 57
Member
|
Member
Joined: Apr 2001
Posts: 57 |
Tell me what $threadheader[8] is and what it prints out. We can go from there if you still want to figure this out. I was assuming it was something like: Headline 1, June 21, 2001
|
|
|
|
Joined: Feb 2001
Posts: 108
Member
|
Member
Joined: Feb 2001
Posts: 108 |
$threadheader[8] is the name of the News Headline. So posting news message with the topic of "News Update" would show "News Update" as the Headline. $TheDate is the date the News Headline was posted. So having $threadheader[8], $TheDate would show: News Update, June 19, 2001 Due to the loop, it posts the date for every news headline, when all I want need is it posted once and all the headlines for that DAY posted beneath it. http://www.skullport.com/index1.shtml You can check the example above and see how ugly it looks. Thanks for everything, p2k [ June 21, 2001 12:14 PM: Message edited by: p2k ]
|
|
|
|
Joined: Oct 2000
Posts: 743
Moderator / Code Fixer
|
Moderator / Code Fixer
Joined: Oct 2000
Posts: 743 |
Cant you just use a counter in your for loop so it only prints it once? first set the conter to 0 outside the for loop. then do something like
if (count = 0) { print "$threadheader[8], $TheDate"; count++; } else { do whatever u want to do here }
I can't afford a good signature editor
|
|
|
|
Joined: Apr 2001
Posts: 57
Member
|
Member
Joined: Apr 2001
Posts: 57 |
Okay, that's what I needed to know. I was looking at your code above, and you never printed out the date variable ($TheDate) within the $PAGE variable. I just saw $threadheader[8] there. But anyway, try this out. Replace this: With this: Let me know how it goes.
|
|
|
|
Joined: May 2001
Posts: 6,708
Member
|
Member
Joined: May 2001
Posts: 6,708 |
Code you made looks good, Hopefully It will work.
|
|
|
|
Joined: Feb 2001
Posts: 108
Member
|
Member
Joined: Feb 2001
Posts: 108 |
My good man, on behalf of everyone at Skullport I'd like to thank you for the time and effort you put into helping me with this problem. It works like a charm and the Headlines have never looked better. *bows* p2k
|
|
|
|
Joined: May 2001
Posts: 6,708
Member
|
Member
Joined: May 2001
Posts: 6,708 |
Yay It finally worked, good work treszoks
|
|
|
|
Joined: Apr 2001
Posts: 57
Member
|
Member
Joined: Apr 2001
Posts: 57 |
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 70
Joined: January 2007
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|