|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
ahem, if (($user_profile[8] ne 'Administrator') && ($username ne $linearray[3])) {&StandardHTML2("$vars_wordlets_links{links_edit_error}"); exit;} Where does it check for Moderators?
|
|
|
|
Joined: Feb 2003
Posts: 179
Member
|
Member
Joined: Feb 2003
Posts: 179 |
lol, I guess the Links forum doesnt have moderators Hey Allen... how about slapping sort links alphabetically (instead of reversed) up in there when poking at it? 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 |
Originally posted by Ian Spence: ahem, 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... 
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
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 
|
|
|
|
Joined: Feb 2003
Posts: 179
Member
|
Member
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: 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: 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: print header( -charset => "$masterCharset", -type => "text/html", ); print qq( $hf->[0]
$TBT <tr bgcolor="$vars_style{TableBorderColor}"> Replace with: print header( -charset => "$masterCharset", -type => "text/html", ); print qq( $hf->[0]
$vars_wordlets_links{links_index_intro}
$TBT <tr bgcolor="$vars_style{TableBorderColor}">
|
|
|
|
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 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 I see you are running 1.8.9, you file compare the changes in?
|
|
|
|
Joined: Feb 2003
Posts: 179
Member
|
Member
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
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
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) 
|
|
|
|
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'll update the zip file to current code by tomorrow 
|
|
|
|
Joined: Feb 2003
Posts: 179
Member
|
Member
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 && ($username ne $linearray[4]) is kosher?
|
|
|
|
Joined: Feb 2003
Posts: 179
Member
|
Member
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: 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: 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 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 
|
|
|
|
Joined: Feb 2003
Posts: 179
Member
|
Member
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 
|
|
|
|
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.
|
|
|
|
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. 
|
|
|
|
Joined: Feb 2003
Posts: 179
Member
|
Member
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. 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 
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
Allen, I just downloaded the dbcats.cgi file and I think I know the problem. 3||Category One||description for catone||4||1069737583||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
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
As for sorting alpha by title, give this a shot. In links.cgi FIND: @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: @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... Thank you 
|
|
|
|
Joined: Feb 2003
Posts: 179
Member
|
Member
Joined: Feb 2003
Posts: 179 |
Thanks Ian! i tested sorting fix and get the following 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
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,834 Likes: 20
UBBDev Owner Time Lord
|
UBBDev Owner Time Lord
Joined: Jan 2000
Posts: 5,834 Likes: 20 |
Originally posted by AllenAyres: heck, I planned to spend at least until October trying to figure this out and you did it today... Thank you Yeh he's a quick monkey like that...
|
|
|
|
Joined: Feb 2003
Posts: 179
Member
|
Member
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 but i gather its better to have strictness on?
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
try changing foreach my $link(@newsorted){ to foreach my @link(@newsorted){
|
|
|
|
Joined: Feb 2003
Posts: 179
Member
|
Member
Joined: Feb 2003
Posts: 179 |
that gives me quote: Software error: Missing $ on loop variable at C:websitesubb6_dragboatalleycgi-binlinks.cgi line 838. and line 838 is... foreach my @link(@newsorted){
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
ugh. @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
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 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  )
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
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 
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
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
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 |
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 
|
|
|
|
Joined: Jan 2000
Posts: 5,834 Likes: 20
UBBDev Owner Time Lord
|
UBBDev Owner Time Lord
Joined: Jan 2000
Posts: 5,834 Likes: 20 |
Ian, you make me so :sniff: proud...
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
ok, got the sorting to work. In links.cgi, Find: @datafile = &OpenFileAsArray("$vars_config{NonCGIPath}/links/db$id.cgi"); @datafile = reverse @datafile; REPLACE WITH: @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: $hf->[1] ); } #end ShowTopTen Add after: 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
Joined: Feb 2003
Posts: 179 |
[giggles] rotorooter. lol, how appropriate!
goes off to test....
|
|
|
|
Joined: Feb 2003
Posts: 179
Member
|
Member
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]](http://dragboatalley.com/ubb/graemlins/csmiley5.gif) and thanks!!! Alan I think you almost got a 'finished' v1x script!  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
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.
|
|
|
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: 87
Joined: December 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|