Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 7 1 2 3 4 5 6 7
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
ahem,

Code
if (($user_profile[8] ne 'Administrator') && ($username ne $linearray[3])) {&StandardHTML2("$vars_wordlets_links{links_edit_error}"); exit;}
Where does it check for Moderators?

Sponsored Links
Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
lol, I guess the Links forum doesnt have moderators wink

Hey Allen... how about slapping sort links alphabetically (instead of reversed) up in there when poking at it? tipsy

Those two fixeys would make this script good enuff for me take it live awhile (i can live without main page lite bulbs for time being). TIA!

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Quote
Originally posted by Ian Spence:

ahem,

Code
if (($user_profile[8] ne 'Administrator') && ($username ne $linearray[3])) {&StandardHTML2("$vars_wordlets_links{links_edit_error}"); exit;}
Where does it check for Moderators?

that's my point... tipsy


- Allen wavey
- What Drives You?
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
right, so change the wordlet so it doesn't mention "moderator" and there's no longer a bug wink

Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
here's the few fixes I'm using on v1.9.3

- To allow moderators and admins to edit links
Find:
Code
 if (($user_profile[8] ne 'Administrator') && ($username ne $linearray[4])) {&StandardHTML2("You must be a moderator or the person who added this link, to edit the record"); exit;}
Replace With:
Code
 if (($user_profile[8] ne 'Administrator') && ($user_profile[8] ne 'Moderator') && ($username ne $linearray[4])) {&StandardHTML2("You must be a moderator or the person who added this link, to edit the record"); exit;} 
- To include the links_index_intro wordlet found in CP
Find:
Code
 		print header(
-charset => "$masterCharset",
-type => "text/html",
);
print qq(
$hf->[0]




$TBT
<tr bgcolor="$vars_style{TableBorderColor}">
Replace with:
Code
 		print header(
-charset => "$masterCharset",
-type => "text/html",
);
print qq(
$hf->[0]



$vars_wordlets_links{links_index_intro}


$TBT
<tr bgcolor="$vars_style{TableBorderColor}">

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Thanx Rox smile

The first one is the one I had in mind for the moderator editing.

The intro text I had in there in earlier versions but it it seemed a bit out of place at the time. It looks good on your site smile

I see you are running 1.8.9, you file compare the changes in?


- Allen wavey
- What Drives You?
Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
oh crap... i poked at the backup copy instead of the 1.9 copy.

lol, yeah I'll be beyond comparing now dang it

Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
p.s. - i put a blockquote in my intro text wordlet to make it look so nice.

Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
ok now if i could just figure out how in heck to sort @datafile in sub ShowCat by the second column ascending (hint hint... nudge nudge... poke poke) wink

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
tipsy I'll update the zip file to current code by tomorrow smile


- Allen wavey
- What Drives You?
Sponsored Links
Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
hey allen, there's still a buglet with editing links. regular member (not an admin nor mod) can't edit their own links, so I'm wondering if this bit

Code
 && ($username ne $linearray[4]) 
is kosher?

Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
ahh - I bet the above logic it isnt kosher when profile has a different login name / public name (which most of my members do).

so now I'm testing this revision to my tweak posted above:

Quote
Originally posted by RoxSeibert:

here's the few fixes I'm using on v1.9.3

- To allow moderators and admins to edit links
Find:
Code
 if (($user_profile[8] ne 'Administrator') && ($username ne $linearray[4])) {&StandardHTML2("You must be a moderator or the person who added this link, to edit the record"); exit;}
Replace with
Code
 if (($user_profile[8] ne 'Administrator') && ($user_profile[8] ne 'Moderator') && ($pubname ne $linearray[4])) {&StandardHTML2("You must be a moderator or the person who added this link, to edit the record"); exit;}
$pubname instead of $username smile

Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
fix confirmed - using $pubname instead of $username did solve the problem that regular members couldnt edit their own links

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
that works wink


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
hmmm.. there's lots of places where $username is used. I'll need to re-check every one of them to make sure pubname isn't needed instead.


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
I changed the 2 related to editing and deleting links... I don't think they needed to be changed anywhere else. smile


- Allen wavey
- What Drives You?
Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
Allen - we put v1.9.4 thru a full round of testing and recent fixes all checked out perfectly and we found no 'new' buglets. thumbsup

Leftover/Remaining issues from previous discussions:
1. Lite bulbs on main page dont turn on (although they work fine on category level pages)
2. List of Links in sub ShowCat sorted alpha by title

my sponsors are really anxious for me to release this as a new feature on my site, any chance you can give me ETA on when you might have a chance to look at these last nits? and thanks again for all your hard work!!

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
I'm not sure why the light bulbs aren't working... I'll try to compare coding and see where the break is. Alpha-by-title... hmmm... mebbe ian has an idea smile


- Allen wavey
- What Drives You?
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
Allen, I just downloaded the dbcats.cgi file and I think I know the problem.

Code
3&#0124;&#0124;Category One&#0124;&#0124;description for catone&#0124;&#0124;4&#0124;&#0124;1069737583&#0124;&#0124;1
You check spot 5 for the time, but remember, numbering starts at 0, so the time is 1 here. Check $linearray[4] instead

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
As for sorting alpha by title, give this a shot.

In links.cgi
FIND:
Code
	@datafile = &OpenFileAsArray("$vars_config{NonCGIPath}/links/db$id.cgi");
@datafile = reverse @datafile;
foreach $thisline(@datafile){
chomp($thisline);
if ($thisline ne '')
{
@linearray = split(/||/,$thisline);
##output it

$on = qq(<img src="$vars_config{NonCGIURL}/on.gif" border="0" alt="$vars_wordlets_links{links_on}" />);
$off = qq(<img src="$vars_config{NonCGIURL}/off.gif" border="0" alt="$vars_wordlets_links{links_off}" />);

if (($linearray[5]+(7*24*60*60))>time) {$off=$on;}

$free = 0;

if ($free != 1){
print qq(
<tr valign="top">
<td bgcolor="$vars_style{AltColumnColor2}" align="center">$off</td>
<td bgcolor="$vars_style{AltColumnColor1}"><b><a href="$base_url/action/info/cat/$catarray[0]/id/$linearray[0]">$linearray[1]</a></b> - $linearray[2]   <font size="$vars_style{FDTextSize}"><b><a href="$base_url/action/get/cat/$catarray[0]/id/$linearray[0]" target="_blank">(Go!)</a></b></font>
<font size="$vars_style{FDTextSize}">$linearray[3]</font></td>
<td bgcolor="$vars_style{AltColumnColor2}" valign="middle"><a href="$profile_base_url/profile/$linearray[7].html"><b>$linearray[4]</b></a></td>
<td bgcolor="$vars_style{AltColumnColor1}" valign="middle" align="center">$linearray[6]</td>
</tr>
);
}
}
}
REPLACE WITH:
Code
	@datafile = &OpenFileAsArray("$vars_config{NonCGIPath}/links/db$id.cgi");
@datafile = reverse @datafile;
my @sorted;
foreach $thisline(@datafile){
chomp($thisline);
if ($thisline ne '') {
@linearray = split(/||/,$thisline);
##output it
push(@sorted, @linearray);
}
}


my @newsorted = sort { $a[1] cmp $b[1] } @sorted;


foreach my $link(@newsorted){

$on = qq(<img src="$vars_config{NonCGIURL}/on.gif" border="0" alt="$vars_wordlets_links{links_on}" />);
$off = qq(<img src="$vars_config{NonCGIURL}/off.gif" border="0" alt="$vars_wordlets_links{links_off}" />);

if (($link[5]+(7*24*60*60))>time) {$off=$on;}

$free = 0;

if ($free != 1){
print qq(
<tr valign="top">
<td bgcolor="$vars_style{AltColumnColor2}" align="center">$off</td>
<td bgcolor="$vars_style{AltColumnColor1}"><b><a href="$base_url/action/info/cat/$catarray[0]/id/$link[0]">$link[1]</a></b> - $link[2]   <font size="$vars_style{FDTextSize}"><b><a href="$base_url/action/get/cat/$catarray[0]/id/$link[0]" target="_blank">(Go!)</a></b></font>
<font size="$vars_style{FDTextSize}">$link[3]</font></td>
<td bgcolor="$vars_style{AltColumnColor2}" valign="middle"><a href="$profile_base_url/profile/$link[7].html"><b>$link[4]</b></a></td>
<td bgcolor="$vars_style{AltColumnColor1}" valign="middle" align="center">$link[6]</td>
</tr>
);
}
}
}
Untested, but should work

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
heck, I planned to spend at least until October trying to figure this out and you did it today...


tipsy

Thank you smile


- Allen wavey
- What Drives You?
Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
Thanks Ian! i tested sorting fix and get the following

Quote
quote:
Software error:
Global symbol "@a" requires explicit package name at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 835. Global symbol "@b" requires explicit package name at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 835. Global symbol "@link" requires explicit package name at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 843. Global symbol "@link" requires explicit package name at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 848. Global symbol "@link" requires explicit package name at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 848. Global symbol "@link" requires explicit package name at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 848. Global symbol "@link" requires explicit package name at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 848. Global symbol "@link" requires explicit package name at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 848. Global symbol "@link" requires explicit package name at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 848. Global symbol "@link" requires explicit package name at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 848. Global symbol "@link" requires explicit package name at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 848. Global symbol "$hf" requires explicit package name at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 860. Unmatched right curly bracket at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 881, at end of line (Might be a runaway multi-line () string starting on line 860) C:websitesubb6_dragboatalleycgi-binlinks.cgi has too many errors.
and there's a copy of the source file for reference at http://dragboatalley.com/links.txt

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
ugh, try removing one of the final }'s from what I told you to add

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
Quote
Originally posted by AllenAyres:

heck, I planned to spend at least until October trying to figure this out and you did it today...


tipsy

Thank you smile
Yeh he's a quick monkey like that...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
ok that trims the mess abit, but I still get the slew of explicit package name whining... until i comment out "use strict" at beginning and it works fine smile

but i gather its better to have strictness on?

Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
correction... doesnt exactly work fine without use strict, just doesnt error out.

html output is whack-a-moled smile
http://dragboatalley.com/cgi-bin/links.cgi?/action/cat/id/6

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
try changing
Code
	foreach my $link(@newsorted){
to

Code
	foreach my @link(@newsorted){

Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
that gives me
Quote
quote:
Software error:
Missing $ on loop variable at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 838.
and line 838 is...
Code
 foreach my @link(@newsorted){

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
ugh.

Code
	@datafile = &OpenFileAsArray("$vars_config{NonCGIPath}/links/db$id.cgi");
@datafile = reverse @datafile;
my @sorted;
foreach $thisline(@datafile){
chomp($thisline);
if ($thisline ne '') {
@linearray = split(/||/,$thisline);
##output it
push(@sorted, @linearray);
}
}


my @newsorted = sort { $a[1] cmp $b[1] } @sorted;


foreach my $link(@newsorted){

$on = qq(<img src="$vars_config{NonCGIURL}/on.gif" border="0" alt="$vars_wordlets_links{links_on}" />);
$off = qq(<img src="$vars_config{NonCGIURL}/off.gif" border="0" alt="$vars_wordlets_links{links_off}" />);

if (($link->[5]+(7*24*60*60))>time) {$off=$on;}
$free = 0;

if ($free != 1){
print qq(
<tr valign="top">
<td bgcolor="$vars_style{AltColumnColor2}" align="center">$off</td>
<td bgcolor="$vars_style{AltColumnColor1}"><b><a href="$base_url/action/info/cat/$catarray[0]/id/$link->[0]">$link->[1]</a></b> - $link->[2]   <font size="$vars_style{FDTextSize}"><b><a href="$base_url/action/get/cat/$catarray[0]/id/$link->[0]" target="_blank">(Go!)</a></b></font>
<font size="$vars_style{FDTextSize}">$link->[3]</font></td>
<td bgcolor="$vars_style{AltColumnColor2}" valign="middle"><a href="$profile_base_url/profile/$link->[7].html"><b>$link->[4]</b></a></td>
<td bgcolor="$vars_style{AltColumnColor1}" valign="middle" align="center">$link->[6]</td>
</tr>
);
}
}
see if that works

Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
thanks Ian. that got rid of the error, but something is still getting whacked. it looks like it's loosing data and gaining lots of blanks in the shuffle between @linearray, @sorted, and @newsorted

http://dragboatalley.com/cgi-bin/links.cgi?/action/cat/id/6

there should be 7 links listed there, and instead we got 63 blanks. Another cat with 4 links shows 36 blanks. almost like its a bug with nine lives smile

note - i still have use strict commented out if that matters

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
08/26/2004 - (v1.9.5) Fixed bug with lightbulbs(thanks Ian Spence smile )


- Allen wavey
- What Drives You?
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
Roxy, remove what I told you to do so it works. I'm gonna install the index and see if I can fix it before breaking your links anymore tipsy

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
Allen, in ShowCat, [5] was the time.

In main page, [4] was the time, so you might want to change showcat back

Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
there's not a public link to my links page... its still in test mode, so no matter if we break it

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Quote
Originally posted by Ian Spence:

Allen, in ShowCat, [5] was the time.

In main page, [4] was the time, so you might want to change showcat back
fixed, thanks smile


- Allen wavey
- What Drives You?
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
Ian, you make me so :sniff: proud...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
ok, got the sorting to work.

In links.cgi,
Find:
Code
	@datafile = &OpenFileAsArray("$vars_config{NonCGIPath}/links/db$id.cgi");
@datafile = reverse @datafile;
REPLACE WITH:
Code
	@datafile = &OpenFileAsArray("$vars_config{NonCGIPath}/links/db$id.cgi");

my @temp = sort { &rotorooter($a, 1) cmp &rotorooter($b, 1) } @datafile;
@datafile = @temp;
# @datafile = reverse @datafile;
FIND:
Code
$hf->[1]
);
} #end ShowTopTen
Add after:
Code
sub rotorooter {
my($line, $sorder) = @_;
my @temp = split(/||/, $line);
return $temp[$sorder];
}
Allen, that sub could allow for sorting at will if you wanted to add that ability for users.

Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
[giggles] rotorooter. lol, how appropriate!

goes off to test....

Joined: Feb 2003
Posts: 179
Member
Member
Offline
Joined: Feb 2003
Posts: 179
v1.9.5+ fixes verified!!

Lite bulbs now work on main page (and still work on cat pages). And Sorting is working perfectly as well!

Bravo Ian [Linked Image] and thanks!!!

Alan I think you almost got a 'finished' v1x script! smile But dont forget - there was still one last weirdness spot on the Admin page when you add more 6 cats that I had to fudge in the text files to clean up before we moved onto the other stuff. Thanks again for all your hard work!

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
I could not recreate any of those problems, however, I reset my files when I got them, so it could be an issue with how the links were set up beforehand in the files.

Page 4 of 7 1 2 3 4 5 6 7

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:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
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-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)