Previous Thread
Next Thread
Print Thread
Rate Thread
#47674 05/18/2001 7:24 AM
Joined: Jan 2001
Posts: 3
Junior Member
Junior Member
Offline
Joined: Jan 2001
Posts: 3
Anyone done a SlashDot type mod to pull top 10 or 20 active topics to be displayed on a news page, along with anything posted in NEWS would appear as well?

Like to old SlashDot for v5, Anyone got one for v6?

Thx!

Sponsored Links
#47675 05/18/2001 9:40 AM
Joined: Aug 2000
Posts: 594
Member
Member
Offline
Joined: Aug 2000
Posts: 594


jeremiah
#47676 05/18/2001 3:05 PM
Joined: May 2001
Posts: 10
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 10
This is fairly simple, it only displays topics, and you can config it for as many or as few as you'd like.
You can add other fields such as username, date, forum name and so on
It's based on the &GetDaily routine
To run the script at specified intervals, you'll need cron and a fetching script. I use a fetching script from the AP Wire. So I can't give it to you. There should be others on the net.
Then use an SSI to put the topics where you want on your web page.
Here's the code:

Find:
&GetDaily;
}

Add:
if ($in{'action'} eq "getdailynh") {
&GetDailynh;
}

Find:
} #end GetDaily

Add:
sub GetDailynh {
&GetDateTime;

if ($AllowSearch eq "FALSE") {
$SearchOption = "";
} else {
$SearchOption = qq(refine search | );
}

if (-e "$NonCGIPath/dailyindex-$LastLoginJulianDATE.file") {
$Daily = "exists";
@daily2 = &OpenFile("$NonCGIPath/dailyindex-$LastLoginJulianDATE.file");
@daily = sort(@daily2);
} else {
$Daily = "";
@daily = @blank;
}

#eliminate duplicates
foreach $check(@daily) {
chomp($check);
(@testit) = split(/|/, $check);
$testit = ("$testit[0]" . "$testit[1]");
$Duplicate = "";

for $dupcheck(@good) {
@testit2 = split(/|/, $dupcheck);
$testit2 = ("$testit2[0]" . "$testit2[1]");
if ($testit eq "$testit2") {
$Duplicate = "true";
}
}

if ($Duplicate ne "true") {
push(@good, $check);
}
}

$MatchTotal = @good;
my $MaxDisplay = 10; #maximum number to view per screen
if ($in{'StartPoint'} eq "") {
$StartPoint = 1;
if ($MatchTotal <= $MaxDisplay) {
$EndPoint = $MatchTotal;
$Done = "true";
} else {
$Done = "";
$EndPoint = $MaxDisplay;
}
$EP = $EndPoint - 1;
@daily = @good[0..$EP];

} else {

$StartPoint = $in{'StartPoint'};
$EndPoint = $StartPoint + $MaxDisplay;
$EndPoint = $EndPoint - 1;
if ($MatchTotal <= $EndPoint) {
$EndPoint = $MatchTotal;
$Done = "true";
} else {
$Done = "";
}

}

#If no matches, return nothing
if ($MatchTotal eq 0){
print<
NADA
exit;
}

$SP = $StartPoint - 1;
$EP = $EndPoint - 1;
@daily = @good[$SP..$EP];

if ($Done ne "true") {
$NextStart = $EndPoint + 1;
$NextWording = qq([Next Topics]);
} else {
$NextWording = "";
}
if ($MatchTotal == 0) {
$StartPoint = 0;
}

print<



Today's TalkBack Topics:


TOP

for $eachone(@daily) {
@goodline = split(/|/, $eachone);
chomp($goodline[5]);

@GetForumName = &GetForumRecord("$goodline[0]");
$ForumName = "$GetForumName[1]";

$HyphenIt = "$goodline[3]";
($ThisMo, $ThisDay, $ThisYear) = split(/-/, $HyphenIt);

if ($DateFormat eq "US") {
$TheDate = "$HyphenIt";
$DateSize = "2";
}
elsif ($DateFormat eq "Euro") {
$TheDate = "$ThisDay-$ThisMo-$ThisYear";
$DateSize = "2";
}
elsif ($DateFormat eq "USX") {
$TheDate = &DateFormat("$HyphenIt", "USExpanded");

$DateSize = "1";
} else {
$TheDate = &DateFormat("$HyphenIt", "EuroExpanded");
$DateSize = "1";
}

if (-e "$NonCGIPath/Forum$goodline[0]/HTML/$goodline[1].html") {
print< $goodline[4]

ROW
}
}


print<
BOTTOM
} #end GetDailynh


"I have no particular talent, I am just extremely inquisitive"
Albert Einstein
#47677 05/18/2001 3:12 PM
Joined: May 2001
Posts: 10
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 10
Oh, and it's helpful to know you need to modify the search.cgi script.
When you want to run the search script to return your active topics without the excess HTML or test your update use this URL
Use yourservername/yourcgi/search2.cgi?action=getdailynh
For example our server's list .


If there are no active topics, this script returns a comment so nothing interferes with the webpage, by displaying an empty list. You can change this as well.
Good luck.


"I have no particular talent, I am just extremely inquisitive"
Albert Einstein

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,824
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 37729
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 12
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)