Article ordering (arrow up/down) does not work

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
creep
Posts: 10
Joined: Tue 28. Dec 2004, 15:53

QuickFix

Post by creep »

Modification for disable ascending /descending if manual (arrow up/down) selected.

1st BACKUP BACKUP BACKUP !!!
Open: include/inc_lib/general.inc.php
arround line 164
After:

Code: Select all

function is_checked($c, $chkvalue, $xml=0) {
	if(strval($c) == strval($chkvalue)) {
		echo (!$xml) ? ' checked' : ' checked="checked"' ;
	}
}
Add:

Code: Select all

function is_checked_disabled($c, $chkvalue, $xml=0) {
  // Addone fo JS checkbox
	if(strval($c) == strval($chkvalue)) {
		echo ' disabled';
	}
}
Save and close file general.inc.php

Open: /include/inc_tmpl/admin.structform.tmpl.php
arround line 119
Replace this code:

Code: Select all

          <tr>
            <td><table border="0" cellpadding="0" cellspacing="0" style="border: 1px solid #D9DEE3;">
                <tr style="padding-top:3px;">
                  <td><img src="img/leer.gif" width="3" height="1"></td>
                  <td><input type="radio" name="acat_order" value="0"<?php is_checked(0, intval($acat_order[0])) ?>></td>
                  <td>&nbsp;<?php echo $BL['be_admin_struct_ordermanual'] ?>&nbsp;&nbsp;&nbsp;</td>
                  <td rowspan="4">&nbsp;&nbsp;&nbsp;&nbsp;</td>
                  <td><input type="radio" name="acat_ordersort" value="0"<?php is_checked(0, intval($acat_order[1])) ?>></td>
                  <td>&nbsp;<?php echo $BL['be_admin_struct_orderasc'] ?>&nbsp;&nbsp;&nbsp;</td>
                </tr>
                <tr>
                  <td><img src="img/leer.gif" width="3" height="1"></td>
                  <td><input type="radio" name="acat_order" value="2"<?php is_checked(2, $acat_order[0]) ?>></td>
                  <td>&nbsp;<?php echo $BL['be_admin_struct_orderdate'] ?>&nbsp;&nbsp;&nbsp;</td>
                  <td><input type="radio" name="acat_ordersort" value="1"<?php is_checked(1, $acat_order[1]) ?>></td>
                  <td>&nbsp;<?php echo $BL['be_admin_struct_orderdesc'] ?>&nbsp;&nbsp;&nbsp;</td>
                </tr>
                <tr>
                  <td><img src="img/leer.gif" width="3" height="1"></td>
                  <td><input type="radio" name="acat_order" value="4"<?php is_checked(4, $acat_order[0]) ?>></td>
                  <td>&nbsp;<?php echo $BL['be_admin_struct_orderchangedate'] ?>&nbsp;&nbsp;&nbsp;</td>
                  <td colspan="2">&nbsp;</td>
                </tr>
                <tr style="padding-bottom:3px;">
                  <td><img src="img/leer.gif" width="3" height="1"></td>
                  <td><input type="radio" name="acat_order" value="6"<?php is_checked(6, $acat_order[0]) ?>></td>
                  <td>&nbsp;<?php echo $BL['be_admin_struct_orderstartdate'] ?>&nbsp;&nbsp;&nbsp;</td>
                  <td colspan="2">&nbsp;</td>
                </tr>
              </table></td>
          </tr>
With:

Code: Select all

          <tr>
            <td><table border="0" cellpadding="0" cellspacing="0" style="border: 1px solid #D9DEE3;">
                <tr style="padding-top:3px;">
                  <td><img src="img/leer.gif" width="3" height="1"></td>
                  <td><input type="radio" name="acat_order" value="0"<?php is_checked(0, intval($acat_order[0])) ?> onClick="Disab (2)"></td>
                  <td>&nbsp;<?php echo $BL['be_admin_struct_ordermanual'] ?>&nbsp;&nbsp;&nbsp;</td>
                  <td rowspan="4">&nbsp;&nbsp;&nbsp;&nbsp;</td>
                  <td><input type="radio" name="acat_ordersort" value="0"<?php is_checked(0, intval($acat_order[1])) ?><?php is_checked_disabled(0, intval($acat_order[0])) ?>></td>
                  <td>&nbsp;<?php echo $BL['be_admin_struct_orderasc'] ?>&nbsp;&nbsp;&nbsp;</td>
                </tr>
                <tr>
                  <td><img src="img/leer.gif" width="3" height="1"></td>
                  <td><input type="radio" name="acat_order" value="2"<?php is_checked(2, $acat_order[0]) ?> onClick="Disab (1)"></td>
                  <td>&nbsp;<?php echo $BL['be_admin_struct_orderdate'] ?>&nbsp;&nbsp;&nbsp;</td>
                  <td><input type="radio" name="acat_ordersort" value="1"<?php is_checked(1, $acat_order[1]) ?><?php is_checked_disabled(0, intval($acat_order[0])) ?>></td>
                  <td>&nbsp;<?php echo $BL['be_admin_struct_orderdesc'] ?>&nbsp;&nbsp;&nbsp;</td>
                </tr>
                <tr>
                  <td><img src="img/leer.gif" width="3" height="1"></td>
                  <td><input type="radio" name="acat_order" value="4"<?php is_checked(4, $acat_order[0]) ?> onClick="Disab (1)"></td>
                  <td>&nbsp;<?php echo $BL['be_admin_struct_orderchangedate'] ?>&nbsp;&nbsp;&nbsp;</td>
                  <td colspan="2">&nbsp;</td>
                </tr>
                <tr style="padding-bottom:3px;">
                  <td><img src="img/leer.gif" width="3" height="1"></td>
                  <td><input type="radio" name="acat_order" value="6"<?php is_checked(6, $acat_order[0]) ?> onClick="Disab (1)"></td>
                  <td>&nbsp;<?php echo $BL['be_admin_struct_orderstartdate'] ?>&nbsp;&nbsp;&nbsp;</td>
                  <td colspan="2">&nbsp;</td>
                </tr>
              </table></td>
          </tr>
arround line 44
Before:

Code: Select all

<table width="538" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
Add:

Code: Select all

<SCRIPT LANGUAGE="JavaScript">
<!--
function Disab (val) {
  if(val=="1") {
    editsitestructure.acat_ordersort[0].disabled=false;
    editsitestructure.acat_ordersort[0].checked=false;
    editsitestructure.acat_ordersort[1].disabled=false;
    editsitestructure.acat_ordersort[1].checked=true;
  }

  if(val=="2") {
    editsitestructure.acat_ordersort[0].disabled=true;
    editsitestructure.acat_ordersort[0].checked=true;
    editsitestructure.acat_ordersort[1].disabled=true;
    editsitestructure.acat_ordersort[1].checked=false;
  }
}
//-->
</script>
Enjoy it.
HNY!!!
Pappnase

Post by Pappnase »

hello

sorry but for what is that!?

there was already a patch for this to solve it!
Igor
Posts: 97
Joined: Fri 30. Apr 2004, 16:30
Location: The Netherlands
Contact:

Post by Igor »

No, patch 6 doesn't solve it.

Nekket wrote:
Or go to the site structure and change article sorting from descending to ascending... should solve the problem too.
This helps.
Igor
design
Posts: 68
Joined: Thu 17. Feb 2005, 17:19

Post by design »

Why when the "manual (arrow up/down)" is checked you can't choose descending order? I have phpwcms v1.2.5.
thanks!
Post Reply