context_title
context_text
Topic Summary - Displaying 10 post(s). Click here to show all
Posted by: Monni Posted on: Oct 13th , 2014 at 3:30pm
Dandello wrote on Oct 13
th , 2014 at 3:15pm:
I'm debating as to whether or not we need to add 'last;' statements in the for loop. It was necessary for BoardIndex.
There is still one extra else statement in your version, but otherwise it looks pretty clean... Adding "last" might make it few milliseconds faster, but otherwise it shouldn't break without, unless the board file contains duplicate entries or your code is buggy
Posted by: Dandello Posted on: Oct 13th , 2014 at 3:15pm
The patch I did for MessageIndex looks like this now:
$bdpic = qq~$imagesdir/boards.$bdpicExt~;
fopen( BRDPIC, "<$boardsdir/brdpics.db" );
my @brdpics = <BRDPIC>;
fclose( BRDPIC);
chomp @brdpics;
for (@brdpics) {
my ( $brdnm, $style, $brdpic ) = split /[|]/xsm, $_;
if ( $brdnm eq $currentboard && $usestyle eq $style) {
if ( $brdpic =~ /\//ism ) {
$bdpic = $brdpic;
}
else {
if ( -e "$htmldir/Templates/Forum/$useimages/Boards/$brdpic" ) {
$bdpic = qq~$imagesdir/Boards/$brdpic~;
}
else { $bdpic = qq~$imagesdir/boards.$bdpicExt~; }
}
}
}
if ( ${ $uid . $currentboard }{'ann'} == 1 ) {
$bdpic = qq~$imagesdir/ann.$bdpicExt~;
}
if ( ${ $uid . $currentboard }{'rbin'} == 1 ) {
$bdpic = qq~$imagesdir/recycle.$bdpicExt~;
}
$bdpic =
qq~ <img src="$bdpic" alt="$curboardname" title="$curboardname" id="brd_img_resize" /> ~;
I'm debating as to whether or not we need to add 'last;' statements in the for loop. It was necessary for BoardIndex.
Posted by: Monni Posted on: Oct 13th , 2014 at 2:59pm
Dandello wrote on Oct 13
th , 2014 at 2:55pm:
This is why it's so good to have multiple testers and code reviewers.
I need to make a new patch because I noticed some of the improvements you made to my patch were actually useful... There was redundant else statements...
Index: cgi-bin/yabb2/Sources/BoardIndex.pm
===================================================================
--- cgi-bin/yabb2/Sources/BoardIndex.pm (revision 1596)
+++ cgi-bin/yabb2/Sources/BoardIndex.pm (working copy)
@@ -822,7 +822,6 @@
if ( -e "$htmldir/Templates/Forum/$useimages/Boards/$brdpic" ) {
$bdpic = qq~$imagesdir/Boards/$brdpic~;
}
- else { $bdpic = qq~$imagesdir/boards.$bdpicExt~; }
last;
}
}
@@ -830,7 +829,6 @@
if ( $boardname =~ m/[ht|f]tp[s]{0,1}:\/\//sm ) {
$bdpic = qq~$imagesdir/$extern~;
}
- else {$bdpic = qq~$imagesdir/boards.$bdpicExt~; }
}
}
@@ -2025,4 +2023,4 @@
}
}
-1;
\ No newline at end of file
+1;
Index: cgi-bin/yabb2/Sources/MessageIndex.pm
===================================================================
--- cgi-bin/yabb2/Sources/MessageIndex.pm (revision 1596)
+++ cgi-bin/yabb2/Sources/MessageIndex.pm (working copy)
@@ -1465,12 +1465,9 @@
if ( $brdpic =~ /\//ism ) {
$bdpic = $brdpic;
}
- else {
+ elsif ( -e "$htmldir/Templates/Forum/$useimages/Boards/$brdpic" ) {
$bdpicfld = 'Boards/';
- if ( -e "$htmldir/Templates/Forum/$useimages/$bdpicfld/$brdpic" ) {
- $bdpic = $brdpic;
- }
- else { $bdpic = qq~boards.$bdpicExt~; }
+ $bdpic = $brdpic;
}
}
}
Posted by: Dandello Posted on: Oct 13th , 2014 at 2:55pm
This is why it's so good to have multiple testers and code reviewers.
Posted by: Monni Posted on: Oct 13th , 2014 at 2:48pm
The new version on subversion still looks wrong... you didn't apply all the changes...
Posted by: Monni Posted on: Oct 13th , 2014 at 2:23pm
Dandello wrote on Oct 13
th , 2014 at 2:05pm:
Thanks - for some reason those sections were just not throwing blanks on my test installs.
That's because you go to admin panel.... I don't.... I just copy the files on server and log in as normal user. It's to test how the changes behave on upgraded forums, especially if change requires new files or settings entries to work correctly... That way it also takes less time to see if new changes break hell loose...
If something doesn't work, I can just revert one or two files to previous revision and diagnose where things fall through defaults...
In cases when something is unreadable, new code should always fall back to a safe default instead of throwing random output or garbage.
Now we know passing undefined to qq returns garbage instead of empty string.
Posted by: Dandello Posted on: Oct 13th , 2014 at 2:05pm
Thanks - for some reason those sections were just not throwing blanks on my test installs.
Posted by: Monni Posted on: Oct 13th , 2014 at 9:37am
For some reason $bdpic is empty in both BoardIndex.pm and MessageIndex.pm.
Index: cgi-bin/yabb2/Sources/BoardIndex.pm
===================================================================
--- cgi-bin/yabb2/Sources/BoardIndex.pm (revision 1595)
+++ cgi-bin/yabb2/Sources/BoardIndex.pm (working copy)
@@ -807,6 +807,7 @@
$INFO{'zeropost'} = 0;
$zero = q{};
$bdpicfld = q{};
+ $bdpic = qq~$imagesdir/boards.$bdpicExt~;
fopen( BRDPIC, "<$boardsdir/brdpics.db" );
my @brdpics = <BRDPIC>;
fclose( BRDPIC);
Index: cgi-bin/yabb2/Sources/MessageIndex.pm
===================================================================
--- cgi-bin/yabb2/Sources/MessageIndex.pm (revision 1595)
+++ cgi-bin/yabb2/Sources/MessageIndex.pm (working copy)
@@ -1454,6 +1454,7 @@
}
}
$bdpicfld = q{};
+ $bdpic = qq~boards.$bdpicExt~;
fopen( BRDPIC, "<$boardsdir/brdpics.db" );
my @brdpics = <BRDPIC>;
fclose( BRDPIC);
@@ -1465,11 +1466,10 @@
$bdpic = $brdpic;
}
else {
- $bdpicfld = 'Boards/';
- if ( -e "$htmldir/Templates/Forum/$useimages/$bdpicfld/$brdpic" ) {
- $bdpic = $brdpic;
- }
- else { $bdpic = qq~boards.$bdpicExt~; }
+ if ( -e "$htmldir/Templates/Forum/$useimages/Boards/$brdpic" ) {
+ $bdpicfld = 'Boards/';
+ $bdpic = $brdpic;
+ }
}
}
}
This makes sure $bdpic is not empty if the board file is empty or does not exist.
Posted by: Dandello Posted on: Oct 13th , 2014 at 4:43am
I've been fighting that glitch. So far it's winning.
Edited: Okay - I've just checked the trunk Revision 1595 and I'm not seeing raw code on Board Pictures. Exactly what screen is showing raw code?
Posted by: Monni Posted on: Oct 13th , 2014 at 4:25am
Latest change in SVN just breaks...
Forum Jump »
Board Index
» 10 most recent Posts
» 10 most recent Topics
News and Updates
YaBB News
General Category
General Board
Test Zone
- Test Sub
- Test sub 2
Showcase
Archived Development Forums
- http://www.yabb26.yabbforumsoftware.com/
YaBB Development
HTML5 and CSS
SQL - yes, we're heading there
New Features
Documentation
On the Road to 2.7
Lounge
Talk it Up
The Comedy Club
Support
Security Announcements
YaBB 2.6.0 and 2.6.1 Support
Other Places
- http://www.yabbforum.com/
- https://www.facebook.com/YaBBForum/
- http://yabbmain.yabbforumsoftware.com/cgi-bin/community/YaBB.pl
Converting to other software
Mod Spot
Mods Wanted (Old Mods)
Mods Wanted (New Mods)
2.6.1 Mods
2.6.0 Mods
- http://www.xonder.com/cgi-bin/yabb26/YaBB.pl
- http://boardmod.de
- http://www.boardmod.org/cgi-bin/forum/YaBB.pl
- http://boardmod26.yabbforumsoftware.com/cgi-bin/yabb2/YaBB.pl
2.5.2 Mods
2.7.00 Mods
- http://yabbforumsoftware.com/cgi-bin/modlang/modlang.pl
Templates for 2.7
Helps
YaBB Administration
Language Packs (2.6)
- Suomi
- Русский
- Deutsch
Language Packs (2.7)
http://yabbforumsoftware.com/cgi-bin/langfix/complang.pl
Bug Zone
YaBB Bugs ««
YaBB 2.7 Issues