Add Poll
 
Options: Text Color Split Pie
 
 
 
 
 
 
 
 
Poll Comment:
Max 500 characters. Remaining characters:
days and minutes. Leave it blank if you don't want to set it now.

Please type the characters exactly as they appear in the image,
without the first 2 and last 2 characters.
The characters must be typed in the same order,
and they are case-sensitive.
Open Preview Preview

You can resize the textbox by dragging the right or bottom border.
Off Topic Comment Insert Spoiler
Insert Hyperlink Insert FTP Link Insert Image Insert E-mail Insert Media Insert Table Insert Table Row Insert Table Column Insert Horizontal Rule Insert Teletype Insert Code Insert Quote Edited Superscript Subscript Insert List /me - my name Insert Marquee Insert Timestamp No Parse
Bold Italicized Underline Insert Strikethrough Highlight
                       
Change Text Color
Insert Preformatted Text Left Align Centered Right Align
resize_wb
resize_hb







Max 5000 characters. Remaining characters:
Text size: %
More Smilies
View All Smilies
Collapse additional features Collapse/Expand additional features Smiley Wink Cheesy Grin Angry Sad Shocked Cool Huh Roll Eyes Tongue Embarrassed Lips Sealed Undecided Kiss Cry
Topic Summary - Displaying 3 post(s). Click here to show all
Posted by: XTC
Posted on: Jun 21st, 2014 at 8:36pm
Hello

@Dandello

I have found it myself out ....

This code works fine  Smiley

Send the id now with

Code (Perl)
Select All
                $sidelinklist .=
                   qq~<option value="$sidelinkname">$sidelinkname</option>~; 



... and the sub to reorder is

Code (Perl)
Select All
## Save Reorder User SiteMenue Links ##
 sub ReorderUserSideMenue2 {
     my $usersidemenue = "$FORM{'sidusername'}";
     my $moveitem = $FORM{'selectlink'};

     if ($moveitem) {
 	fopen(FILE,"+<$memberdir/Sidemenue/$usersidemenue.sidem");
 		@data = (<FILE>);
 		seek(FILE,0,0);
 		truncate(FILE,0);

 			for ($i=0; $i<scalar(@data); $i++) {
 				($sidelinkname,$sideurl,$sideblank) = split(/\|/,$data[$i],3);
 				if ($sidelinkname eq $moveitem) {last;}
 			}
 			if ($FORM{'moveup'} && $i != 0) {
 				@twocat = ($data[$i],$data[$i-1]);
 				splice(@data,$i-1,2,@twocat);
 			}
 			elsif ($FORM{'movedown'} && $i != scalar(@data)) {
 				@twocat = ($data[$i+1],$data[$i]);
 				splice(@data,$i,2,@twocat);
 			}
 		print {FILE} @data or croak "$croak{'print'} FILE";
 	fclose(FILE);
     }


     $yySetLocation = qq~$scripturl?action=sideusermenuepanel;username=$usersidemenue~;
     redirectexit();
     return;
 } 



Thx lg XTC
Posted by: Dandello
Posted on: Jun 21st, 2014 at 2:45pm
I won't have time until Monday or so. But I'll look.  Wink
Posted by: XTC
Posted on: Jun 21st, 2014 at 2:29pm
Hello

I work on the Sidemenu Mod (have make this for many years for yabb 1.3/1.4) ... now i bring it back with new functions to YaBB 2.6.0

A screen you can see here
http://www.xonder.com/cgi-bin/yabb26/YaBB.pl?num=1403094838

The finalstatus is ~ 90 %

I have only one problem with reorder Sidemenue Links ... and i hope you can help me with this code.

It works with my old code (Copy & Paste) .... but i want make it with "moveup" and "movedown" Button like "Reorder Category". Can you take a look of my code ... why this not work  Shocked

The test input look like this ....

Code (Perl)
Select All
test2|http://www.xonder.at|0
 test1|http://www.xonder.at|0
 test3|http://www.xonder.com| 



To display the Reorder Links (same as Reorder Category) is this one.

Code (Perl)
Select All
    if ( @sidemenuelist > 1 ) {
         $catcnt = @sidemenuelist;
         $catnum = $catcnt;
         if ( $catcnt < 4 ) { $catcnt = 4; }
         $sidelinklist =
 qq~<select name="selectlink" id="selectlink" size="$catcnt" style="width: 190px;">~;
         foreach my $category (@sidemenuelist) {
             chomp $category;
             ( $sidelinkname, undef, undef ) = split /\|/xsm, $category, 2;
             ToChars($sidelinkname);
                 $sidelinklist .=
                   qq~<option value="$category">$sidelinkname</option>~;
         }
         $sidelinklist .= q~</select>~;
     }


     $yymain .= qq~
 <br /><br />
 <form action="$scripturl?action=reorderusersidemenue2" method="post" accept-charset="$yymycharset">
    <input type="hidden" name="sidusername" value="$INFO{'username'}">
     <table class="bordercolor border-space pad-cell" style="width:525px">
         <tr>
             <td class="titlebg">$admin_img{'board'} <b>$sidemenuetxt{'16'}</b></td>
         </tr><tr>
             <td class="windowbg">~;

     if ( $catnum > 1 ) {
         $yymain .= qq~
                 <div style="float: left; width: 280px; text-align: left; margin-bottom: 4px;" class="small"><label for="selectlink">$admin_txt{'738'}</label></div>
                 <div style="float: left; width: 230px; text-align: center; margin-bottom: 4px;">$sidelinklist</div>
                 <div style="float: left; width: 280px; text-align: left; margin-bottom: 4px;" class="small">$admin_txt{'738a'}</div>
                 <div style="float: left; width: 230px; text-align: center; margin-bottom: 4px;">
                     <input type="submit" value="<-" name="moveup" style="font-size: 11px; width: 95px;" class="button" />
                     <input type="submit" value="->" name="movedown" style="font-size: 11px; width: 95px;" class="button" />
                 </div>~;
     }
     else {
         $yymain .= qq~
                 <div class="small" style="text-align: center; margin-bottom: 4px;">$admin_txt{'738b'}</div>~;
     }
     $yymain .= q~
             </td>
         </tr>
     </table>
 </form>
 ~; 



... and here te sub to reorder ... but the Links are always placed on the same point.

Code (Perl)
Select All
## Save Reorder User SiteMenue Links ##
 sub ReorderUserSideMenue2 {
     my $usersidemenue = "$FORM{'sidusername'}";
     my $moveitem = $FORM{'selectlink'};

     fopen( SIDEFILE, "$memberdir/Sidemenue/$usersidemenue.sidem" );
     my @sidemenue = <SIDEFILE>;
     fclose(SIDEFILE);

     if ($moveitem) {
         if ( $FORM{'moveup'} ) {
             for my $i ( 0 .. ( @sidemenue - 1 ) ) {
                 if ( $sidemenue[$i] eq $moveitem && $i > 0 ) {
                     $j                 = $i - 1;
                     $sidemenue[$i] = $sidemenue[$j];
                     $sidemenue[$j] = $moveitem;
                     last;
                 }
             }
         }
         elsif ( $FORM{'movedown'} ) {
             for my $i ( 0 .. ( @sidemenue - 1 ) ) {
                 if ( $sidemenue[$i] eq $moveitem && $i < $#sidemenue ) {
                     $j                 = $i + 1;
                     $sidemenue[$i] = $sidemenue[$j];
                     $sidemenue[$j] = $moveitem;
                     last;
                 }
             }
         }

 # Print sidemenuelink to file
     fopen( SIDEFILE, ">$memberdir/Sidemenue/$usersidemenue.sidem" );
     print {SIDEFILE} @sidemenue or croak "$croak{'print'} SIDEFILE";
     fclose(SIDEFILE);

    }

     $yySetLocation = qq~$scripturl?action=sideusermenuepanel;username=$usersidemenue~;
     redirectexit();
     return;
 } 



@Dandello ... can you help me  Smiley

lg XTC