Scoop -- the swiss army chainsaw of content management
Front Page · Everything · News · Code · Help! · Wishlist · Project · Scoop Sites · Dev Notes · Latest CVS changes · Development Activities
Scoop Box Exchange - Show Box: recent_diaries 1.03

Author: graouts [Info]

Description:

Bug fix for wrong link generation around nickname.

Box Code:

####
# New diary list
# by Randy, tweaked by steve@silicongoblin.com
# Bug fix by bhuston(at)vegdot.org for schema
# change post Oct 2003 (the meaning of
# stories.aid changed from nickname to uid)
# Continue to use recent_diaries2 if your
# scoop is prior this date.
#
# Bug fix by antoine (at) graougraou (dot) com for
# wrong link generation around nickname.
##
# Vars:
# num_diaries: how many to show in the box
# trim_length: length of title to trim to for display
# (will display complete words up to this length)
# split_length: longest words allowed in title without
# splitting (I had a user title a diary entry
# "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
# which rather messed my columns up :P)
# split_with: what to split words longer than
# split_length with
#
# Warning: contains hacked, ugly HTML still
####

my ($content, $num_diaries, $trim_length) = ('', 10 , 62);
my ($split_length, $split_with) = (17, "<br>\n");

my $uid = $S->{UID};

# Get the last $num_diaries Diary entries, and information about how many comments
# are attached, and how many of these have been seen by the viewer.


my ($rv, $sth) = $S->db_select({
WHAT => q(s.sid, s.title, s.aid, s.tid, s.time, count(c.cid)),
FROM => qq(stories AS s
LEFT OUTER JOIN comments AS c ON c.sid = s.sid),
WHERE => q(s.section="Diary" AND s.displaystatus = 1),
GROUP_BY => q(s.sid),
ORDER_BY => q(s.time DESC),
LIMIT => $num_diaries
});

my $table = $sth->fetchall_arrayref;

# Now get the viewed_story information for each of the selected stories.
# Doing it this way is MUCH faster than doing two outer joins.
# Skip this step if the viewer isn't logged in.

my %lastseen = ();

if ($uid > 0) {
my $sids = join ',', map qq('$_->[0]'), @$table;

my ($rv, $sth) = $S->db_select({
WHAT => q(s.sid, v.lastseen),
FROM => qq(stories AS s, viewed_stories AS v),
WHERE => qq(v.sid = s.sid AND v.uid=$uid AND s.sid IN ($sids)),
});

my $table2 = $sth->fetchall_arrayref;
$lastseen{$_->[0]} = $_->[1] for @$table2;
}

for (@$table) {
my ($sid, $title, $aid, $tid, $time, $comments) = @$_;
# my $lastseen = exists $lastseen{$sid} ? $lastseen{$sid} : $comments;
my $lastseen = exists $lastseen{$sid} ? $lastseen{$sid} : 0;

if (length $title > $trim_length) {
$title = substr($title, 0, $trim_length);
$title =~ s/\s+\S+$//;
$title .= '...';
}
# my $new_text = (($uid < 1) || exists $lastseen{$sid}) ? '' : qq(<span style="color: red;">[!] </span>);
# my $new_text = (($uid < 1) || (exists $lastseen{$sid})) ? '' : qq(<span style="color: red;">[!] </span>);
my $new_text = exists $lastseen{$sid} ? '' : qq(<span style="color: red;">[!] </span>);
$new_text = '' unless $uid > 0;

# Split long words in the title, so users can't go "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah"
# and fsck up my columns anymore.
$title =~ s[(\S{$split_length,})][join $split_with, grep(/^./, split/(\S{$split_length})/, $1)]ge;

my $new_comments = $comments - $lastseen;
my $comments_text = '';

if ($comments) {
$comments_text = qq(<br>\n<b>$comments</b> comment) . ($comments == 1 ? '' : 's');
$comments_text .= qq( (<b><font color='red'>$new_comments</font> new</b>)) if $new_comments && ($uid > 0);
};

my $month = (qw/Null January February March April May June July August September October November December/)[substr($time, 5, 2)];
my $day = 0 + substr($time, 8, 2);

my $nick=$S->get_nick_from_uid($aid);
$content .= qq{<font face="arial, helvetica, sans-serif" size="-1">$new_text<b><a href="|rootdir|/?op=displaystory;sid=$sid">$title</a></b></font><br>
<font face="arial, helvetica, sans-serif" size="-2">by <a href="/?op=section;section=Diary;user=$nick">$nick</a> - $month $day$comments_text
</font><br><br>};

}

# Add the "More..." link for diaries
$content .= qq{
<BR><A HREf="|rootdir|/?op=search;type=diary;offset=$num_diaries">More Diaries...</a>
|smallfont_end|
};

# And return the content, like normal.
return {content => $content};
Display: Sort:
dani (none / 0) (#1)
by johnb6174 on Mon Sep 25, 2017 at 02:56:11 AM PST

Nice to read your article! I am looking forward to sharing your adventures and experiences. new futura sale



  • aaa by barristersge, 07/21/2020 10:49:46 PM PST (none / 0)
  • aaa by barristersge, 07/31/2020 01:10:42 AM PST (none / 0)
  • aaa by barristersge, 08/10/2020 08:06:23 AM PST (none / 0)
  • aaa by barristersge, 08/10/2020 08:06:23 AM PST (none / 0)
  • aaa by barristersge, 08/11/2020 01:50:12 AM PST (none / 0)
  • aaa by barristersge, 08/11/2020 01:50:13 AM PST (none / 0)
dani (none / 0) (#2)
by johnb6174 on Tue Sep 26, 2017 at 03:16:25 AM PST

Really a great addition. I have read this marvelous post. Thanks for sharing information about it. I really like that. Thanks so lot for your convene. SDK Mediapulsertb



  • aaa by barristersge, 07/23/2020 10:20:35 PM PST (none / 0)
jams (none / 0) (#3)
by regiyef on Sat Jul 18, 2020 at 12:48:51 PM PST

Nice knowledge gaining article. This post is really the best on this valuable topic. 2cb test kit



  • aaa by barristersge, 07/28/2020 02:15:09 AM PST (none / 0)
  • aaa by barristersge, 07/31/2020 10:28:04 AM PST (none / 0)
  • aaa by barristersge, 07/31/2020 10:28:04 AM PST (none / 0)
  • aaa by barristersge, 07/31/2020 10:28:07 AM PST (none / 0)
  • aaa by barristersge, 08/01/2020 10:00:10 AM PST (none / 0)
  • aaa by barristersge, 08/01/2020 09:21:32 PM PST (none / 0)
jams (none / 0) (#4)
by regiyef on Sun Jul 19, 2020 at 01:39:15 AM PST

useful information on topics that plenty are interested on for this wonderful post.Admiring the time and effort you put into your b!.. PMA test kit



  • aaa by barristersge, 07/26/2020 04:01:44 AM PST (none / 0)
  • aaa by barristersge, 08/11/2020 01:02:16 PM PST (none / 0)
jams (none / 0) (#5)
by regiyef on Mon Jul 20, 2020 at 01:32:20 AM PST

I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. Thanks... sŕn Wefinex



  • aaa by barristersge, 07/30/2020 09:23:00 PM PST (none / 0)
  • aaa by barristersge, 07/30/2020 09:23:00 PM PST (none / 0)
  • aaa by barristersge, 08/05/2020 09:30:46 PM PST (none / 0)
  • aaa by barristersge, 08/11/2020 06:20:18 AM PST (none / 0)
AAA (none / 0) (#6)
by barristersge on Mon Jul 20, 2020 at 12:25:48 PM PST

Positive site. where did u come up with the information on this posting? I'm pleased I discovered it though. ill be checking back soon to find out what additional posts you include. Delray Beach Personal Training



  • aaa by barristersge, 07/21/2020 06:45:45 AM PST (none / 0)
  • aaa by barristersge, 08/01/2020 05:35:19 AM PST (none / 0)
  • aaa by barristersge, 08/17/2020 12:36:48 AM PST (none / 0)
  • aaa by barristersge, 08/17/2020 12:36:48 AM PST (none / 0)
aaa (none / 0) (#7)
by beri on Tue Jul 21, 2020 at 03:11:33 AM PST

Thank you very much for this great post. top fashion influencer



AAA (none / 0) (#9)
by beri on Tue Jul 21, 2020 at 10:25:17 PM PST

It is a great website.. The Design looks very good.. Keep working like that!. Boca Raton Fitness Center



AAA (none / 0) (#11)
by barristersge on Thu Jul 23, 2020 at 06:29:35 AM PST

i read a lot of stuff and i found that the way of writing to clearifing that exactly want to say was very good so i am impressed and ilike to come again in future.. giá máy triệt lông opt shr



aaa (none / 0) (#14)
by barristersge on Sun Jul 26, 2020 at 08:51:23 AM PST

Great survey. I'm sure you're getting a great response. https://www.allseasonspest.com/pest-control-kent-wa/



AAA (none / 0) (#32)
by barristersge on Fri Aug 14, 2020 at 12:04:13 PM PST

Its a great pleasure reading your post.Its full of information I am looking for and I love to post a comment that "The content of your post is awesome" Great work. olcsó gépszállítás Dunaújváros



GOOD (none / 0) (#35)
by mahamkhan on Wed Aug 19, 2020 at 09:27:51 AM PST

Good things come to those who wait. So there I am all in the favour of this site how-to-request-an-e-signature-with-signnow . Because it have the best services I ever seen, and for this I waited for so long to happen.



asdsa (none / 0) (#36)
by nacaj on Wed Sep 09, 2020 at 12:44:55 PM PST

You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. kệ sięu thị onetech



mtom (none / 0) (#37)
by mtom78632 on Sat Sep 12, 2020 at 01:47:42 AM PST

Attractive part of content. I just stumbled upon your site and in accession capital to claim that I acquire in fact enjoyed account your blog posts. Any way I'll be subscribing to your feeds and even I achievement you get entry to constantly quickly. 우리카지노 ----------------------- Greetings I am so thrilled I found your site, I really found you by mistake, while I was searching on Aol for something else, Anyhow I am here now and would just like to say kudos for a remarkable post and a all round thrilling blog (I also love the theme/design), I don't have time to look over it all at the moment but I have saved it and also added in your RSS feeds, so when I have time I will be back to read a great deal more, Please do keep up the superb job. 엔트리파워볼



GOOD (none / 0) (#38)
by mahamkhan on Mon Sep 14, 2020 at 10:20:14 AM PST

Looking for Haryana Board 12th class previous year Question Papers? If yes. then you are in the right section. Students here we are going to provide you HBSE 12th Previous Year Question Paper so that you can begin your preparation with the right Haryana 12th Important Question reference. Students though you will find hell lot of study material in the market there also you have to become choosy. So to fetch you out from this problem here we have brought HBSE 12th Previous Year Paper. You can download Haryana Board 12th Class Previous Papers by just clicking on the below-given links to access the papers.



mtom (none / 0) (#39)
by mtom78632 on Sun Oct 18, 2020 at 03:17:45 AM PST

After study many of the blog posts for your site now, and I really like your means of blogging. I bookmarked it to my bookmark web site list and are checking back soon. Pls look at my web site also and let me know how you feel. 더킹카지노



magzinetoday (none / 0) (#40)
by mtom78632 on Sun Oct 18, 2020 at 08:19:31 AM PST

when it comes to beautiful smile and beautiful teeth, Rachel McAdams have it all:: judi online ====================================================================================== Great weblog right here! Also your website so much up very fast! What web host are you using? Can I am getting your affiliate hyperlink on your host? I wish my website loaded up as fast as yours lol. legit online payday loans from EasyFinance



assad (none / 0) (#41)
by nacaj on Thu Oct 22, 2020 at 11:47:55 AM PST

I have not any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. ngô ngọc hňa



mtom (none / 0) (#42)
by mtom78632 on Tue Oct 27, 2020 at 07:34:08 AM PST

Appreciate it for this post, I am a big fan of this website would like to keep updated. สำนักงานให้เช่&# 3634; ---------------------- Pretty element of content. I just stumbled upon your weblog and in accession capital to assert that I get actually enjoyed account your weblog posts. Anyway I will be subscribing to your feeds or even I achievement you get admission to consistently rapidly. 바카라사이트



asdsad (none / 0) (#43)
by nacaj on Sun Nov 01, 2020 at 03:35:44 AM PST

Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. du lich binh dinh - quy nhon



asdd (none / 0) (#44)
by nacaj on Mon Nov 02, 2020 at 09:26:45 AM PST

I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. work injury lawyer in connecticut



sdad (none / 0) (#45)
by nacaj on Tue Nov 03, 2020 at 04:43:43 AM PST

I haven't any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. bán hủ thủy tinh



asdsad (none / 0) (#46)
by nacaj on Fri Nov 06, 2020 at 02:54:43 AM PST

Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they've added something worthwhile to the world wide web!.. Online cake delivery in Ahmedabad



asdad (none / 0) (#47)
by nacaj on Sat Nov 07, 2020 at 08:45:28 AM PST

Great job for publishing such a beneficial web site. Your web log isn't only useful but it is additionally really creative too. There tend to be not many people who can certainly write not so simple posts that artistically. Continue the nice writing dashiki men



asda (none / 0) (#48)
by nacaj on Mon Nov 09, 2020 at 03:27:21 PM PST

I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. business card printing derby



asd (none / 0) (#49)
by nacaj on Tue Nov 10, 2020 at 04:58:14 PM PST

I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. KeeHee - Pandora Box for Dating



asdas (none / 0) (#50)
by nacaj on Wed Nov 25, 2020 at 09:34:11 AM PST

All the contents you mentioned in post is too good and can be very useful. I will keep it in mind, thanks for sharing the information keep updating, looking forward for more posts.Thanks end of tenancy clean Leeds



mtom (none / 0) (#51)
by mtom78632 on Fri Nov 27, 2020 at 01:53:34 PM PST

Great post, are you looking for real estate in Sanford, FL? Learn where the deals are, get short sale lists and find homes for sale in Oviedo. online chat rooms



magzinetoday (none / 0) (#52)
by mtom78632 on Sun Dec 06, 2020 at 03:42:41 AM PST

J'ai la possibilité de vous en communiquer les adresses pour toujours plus d'images sur cet idée. Joignez moi simplement! casino stars ================================================= you possess a excellent weblog here! want to make some invite posts on my own weblog? 토토



mtom (none / 0) (#53)
by mtom78632 on Mon Dec 07, 2020 at 04:06:05 AM PST

Thank you for sharing your stuff on blog. it's probably that we have similar interests. something are very useful to me. hacker ff ------------------- I really like the method that you write, it had me thinking. I??m on the verge of bookmark this. undangan digital



wsdw (none / 0) (#54)
by ftyuoketyy on Tue Jan 19, 2021 at 11:36:58 PM PST

Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts. fotolijst 40x60



asad (none / 0) (#55)
by nacaj on Tue Jan 26, 2021 at 08:04:24 AM PST

I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. https://din-psykolog.dk/psykolog-randers



saa (none / 0) (#56)
by nacaj on Fri Jan 29, 2021 at 04:45:23 PM PST

Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they've added something worthwhile to the world wide web!.. Carl Robert Scholz



asds (none / 0) (#57)
by nacaj on Sat Jan 30, 2021 at 08:23:25 AM PST

Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they've added something worthwhile to the world wide web!.. uwin 2021



asdsad (none / 0) (#58)
by nacaj on Sat Feb 06, 2021 at 12:06:34 PM PST

I think this is a really good article. You make this information interesting and engaging. You give readers a lot to think about and I appreciate that kind of writing. lyft



yok (none / 0) (#59)
by mtom78632 on Sun Feb 07, 2021 at 09:40:19 AM PST

Someone Sometimes with visits your blog regularly and recommended it in my experience to read as well. The way of writing is excellent and also the content is top-notch. Thanks for that insight you provide the readers! 토토 =-=- How is the new year going? I hope to read more interesting posts like last year slot joker123



asdsad (none / 0) (#60)
by nacaj on Sun Feb 14, 2021 at 11:36:26 AM PST

I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. brace yourself



lovely (none / 0) (#61)
by daniyal33 on Wed Feb 17, 2021 at 02:45:54 AM PST

This naming firms offers a step-by-step naming course with coaching sessions included.It was a huge help and is unlike anything else out there



asdd (none / 0) (#62)
by nacaj on Sun Feb 21, 2021 at 05:47:09 AM PST

Thanks a lot for sharing us about this update. Hope you will not get tired on making posts as informative as this. markise



asdasd (none / 0) (#63)
by nacaj on Sun Feb 21, 2021 at 11:40:29 AM PST

Thanks for your post. I've been thinking about writing a very comparable post over the last couple of weeks, I'll probably keep it short and sweet and link to this instead if thats cool. Thanks. https://aussietreeprosballarat.com.au



sam (none / 0) (#64)
by mtom78632 on Sun Jul 04, 2021 at 07:49:39 AM PST

My friend first found your blog on Google and she referred your blog to me . 휴게텔 ======================================================= When I originally commented I clicked the -Notify me when new surveys are added- checkbox and already whenever a comment is added I am four emails with similar comment. Could there be however you possibly can remove me from that service? Thanks! 먹튀검증



mtom (none / 0) (#65)
by mtom78632 on Sat Jul 24, 2021 at 09:20:00 AM PST

sometimes you got to taper down on playing too much compter games coz it is quite addictive;; 토토사이트 --------------------- I'm impressed, I must say. Actually rarely must i encounter a blog that's both educative and entertaining, and without a doubt, you could have hit the nail around the head. Your notion is outstanding; the catch is an element that insufficient folks are speaking intelligently about. We are very happy i always came across this inside my search for something about it. 출장샵



sa (none / 0) (#66)
by mtom78632 on Tue Aug 03, 2021 at 10:04:27 AM PST

Youre so cool! I dont suppose Ive learn anything like this before. So good to seek out any person with some authentic thoughts on this subject. realy thanks for beginning this up. this web site is one thing that's wanted on the internet, somebody with slightly originality. helpful job for bringing something new to the web! rental car in karachi



sa (none / 0) (#67)
by mtom78632 on Thu Aug 12, 2021 at 07:06:57 AM PST

Hello I really like your post and I think that it's curious. I would like to use it in my article. Is it possible? Of course, I will write a source 먹튀검증사이트 ======================================================= I believe this site has very good written subject matter content . Login joker123



,mo (none / 0) (#68)
by mtom78632 on Thu Aug 12, 2021 at 08:09:55 AM PST

It's difficult to acquire knowledgeable men and women within this topic, and you could be seen as you know what you are dealing with! Thanks sbobet ------- Just wanna remark on few general things, The website style is ideal, the topic matter is rattling good smm panel instagram followers



sa (none / 0) (#69)
by mtom78632 on Tue Aug 17, 2021 at 06:29:45 AM PST

I always was interested in this subject and still am, appreciate it for posting . 私人補習 ======================================================= Generally I don't read post on blogs, however I wish to say that this write-up very compelled me to take a look at and do it! Your writing taste has been amazed me. Thanks, quite great post. Long Island Tree Services



sa (none / 0) (#70)
by mtom78632 on Wed Sep 01, 2021 at 04:37:47 AM PST

Hmm it looks like your blog ate my first comment (it was extremely long) so I guess I'll just sum it up what I had written and say, I'm thoroughly enjoying your blog. I as well am an aspiring blog blogger but I'm still new to the whole thing. Do you have any helpful hints for rookie blog writers? I'd definitely appreciate it. sbobet login



sam (none / 0) (#71)
by mtom78632 on Tue Sep 14, 2021 at 07:20:43 AM PST

I impressed, I need to say. Really not often do I encounter a blog that each educative and entertaining, and let me tell you, you have hit the nail on the head. Your concept is outstanding; the problem is something that not sufficient persons are speaking intelligently about. I'm very comfortable that I stumbled across this in my seek for one thing referring to this. Buy dankwoods online



mom (none / 0) (#72)
by mtom78632 on Wed Sep 29, 2021 at 08:56:43 AM PST

Hmm it appears like your blog ate my first comment (it was extremely long) so I guess I'll just sum it up what I submitted and say, I'm thoroughly enjoying your blog. I too am an aspiring blog blogger but I'm still new to everything. Do you have any points for beginner blog writers? I'd genuinely appreciate it. 小學補習



FH (none / 0) (#73)
by mtom78632 on Wed Nov 03, 2021 at 03:37:00 AM PST

I simply added your website to my favorite features. I really like reading your posts. Thanks! once upon a child franchise================================================ What i do not realize is actually how you are not actually much more well-liked than you might be now. You are so intelligent. You realize therefore considerably relating to this subject, made me personally consider it from a lot of varied angles. Its like women and men aren't fascinated unless it's one thing to do with Lady gaga! Your own stuffs nice. Always maintain it up! learn all about blunts



moom (none / 0) (#74)
by mtom78632 on Sat Dec 18, 2021 at 01:06:39 AM PST

Hello! I recently would choose to make a enormous thumbs up for the great information you have here for this post. We are coming back to your blog site for much more soon. 가라오케 =-= There's clearly big money to discover more regarding this. I assume you made certain good aspects within alternatives additionally. 메이저사이트



Menu
· create account
· faq
· search
· report bugs
· Scoop Administrators Guide
· Scoop Box Exchange

Scoop Site Scroller: Get one yourself!
Keepers of Lists
Got Lists? We've got over 1800

Login
Make a new account
Username:
Password:

Hosted by ScoopHost.com Powered by Scoop
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest © 1999 The Management

create account | faq | search