Any core hack hor arange category ?

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.

Any core hack hor arange category ?

Postby culda_a on Fri Jan 30, 2009 08:54

I need to know if is possible to arange the category in alphabetical order:

viewtopic.php?f=1&t=18330&p=113205#p113205
ImagePackging design,labels, catalogs,postcards,
culda_a
 
Posts: 466
Joined: Tue Feb 28, 2006 00:39

Re: Any core hack hor arange category ?

Postby breitsch on Fri Jan 30, 2009 09:56

No guaranty!

Backend:
include\inc_lib\admin.functions.inc.php
around row 30
find:
Code: Select all
   $sql  = "SELECT * FROM ".DB_PREPEND."phpwcms_articlecat WHERE acat_trash=0 AND acat_struct=".intval($id)." ORDER BY acat_sort";

change to
Code: Select all
   $sql  = "SELECT * FROM ".DB_PREPEND."phpwcms_articlecat WHERE acat_trash=0 AND acat_struct=".intval($id)." ORDER BY acat_name";


Frontend:
include\inc_front\front.func.inc.php
around row 392
find:
Code: Select all
   $sql .= "acat_trash=0 ORDER BY acat_struct, acat_sort";

change to:
Code: Select all
   $sql .= "acat_trash=0 ORDER BY acat_name";


You can NOT change the sort order manually anymore.
gruss / regards
breitsch
breitsch
 
Posts: 304
Joined: Sun Mar 06, 2005 22:12
Location: bern switzerland

Re: Any core hack hor arange category ?

Postby culda_a on Fri Jan 30, 2009 10:07

Thank you , I will try it and let you know if it works
ImagePackging design,labels, catalogs,postcards,
culda_a
 
Posts: 466
Joined: Tue Feb 28, 2006 00:39

Re: Any core hack hor arange category ?

Postby culda_a on Tue Feb 03, 2009 09:16

i HAVE TRY THE CODE AND IS WORKING BUT AFTER THAT i HAVCE TRY to see if i put the original code back and to keep that arangement and to have also the manual sort function also....then I have seen that again all is randomly arange , is not keeping the alfabetical order and I get this error also:
Code: Select all
Warning: include_once(/home/budo/public_html/include/inc_lib/admin.structure.inc.php) [function.include-once]: failed to open stream: No such file or directory in /home/budo/public_html/phpwcms.php on line 464

Warning: include_once() [function.include]: Failed opening '/home/budo/public_html/include/inc_lib/admin.structure.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/budo/public_html/phpwcms.php on line 464
structura site


ALSO I have try to put back with the code that arange in the alfabetical; order and I get this error:
Code: Select all
Fatal error: Call to undefined function get_root_childcount() in /home/budo/public_html/include/inc_tmpl/admin.structlist.tmpl.php on line 58


and the structure is not availabel anymore
and in front end I get this error:
Code: Select all
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/budo/public_html/include/inc_front/front.func.inc.php on line 6039

ok what should I do?
ImagePackging design,labels, catalogs,postcards,
culda_a
 
Posts: 466
Joined: Tue Feb 28, 2006 00:39

Re: Any core hack hor arange category ?

Postby culda_a on Tue Feb 03, 2009 09:23

also I see that I can not add anymore no category in the structure.
ImagePackging design,labels, catalogs,postcards,
culda_a
 
Posts: 466
Joined: Tue Feb 28, 2006 00:39

Re: Any core hack hor arange category ?

Postby breitsch on Tue Feb 03, 2009 10:22

what have you done?

put back the original files, best would be the whole include folder.
try it again
do only change the two lines as described above
when you change the code as described NO manually arrangement is possible anymore, till you go back to the original code

Almost certainly you messed things up. For the error messages you need to do more than the changes I described.
gruss / regards
breitsch
breitsch
 
Posts: 304
Joined: Sun Mar 06, 2005 22:12
Location: bern switzerland

Re: Any core hack hor arange category ?

Postby culda_a on Tue Feb 03, 2009 19:00

well I put back original files and is all ok, then I hve try again with your instructions ..in the backend is all fine but in frontend I get this error:
Code: Select all
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/budo/public_html/include/inc_front/front.func.inc.php on line 3012


and is show only that error,


and to line 3012 I have this code:
Code: Select all
      $redirect = get_redirect_link($GLOBALS['content']['struct'][$key]["acat_redirect"], ' ''', ''','','');


what is wrong now?
ImagePackging design,labels, catalogs,postcards,
culda_a
 
Posts: 466
Joined: Tue Feb 28, 2006 00:39

Re: Any core hack hor arange category ?

Postby culda_a on Tue Feb 03, 2009 19:06

also I have seen that after I switch back to orginal code is not keeping the alfabetical order, any ideea how to do that to keep the alfabetical order and to have the posibility to move(arange) each category separatly up and down?
ImagePackging design,labels, catalogs,postcards,
culda_a
 
Posts: 466
Joined: Tue Feb 28, 2006 00:39

Re: Any core hack hor arange category ?

Postby breitsch on Tue Feb 03, 2009 20:33

Are you testing me?

What application do you use to edit the files?

culda_a wrote:...nc_front/front.func.inc.php on line 6039

front.func.inc never had 6039 lines!

culda_a wrote:$redirect = get_redirect_link($GLOBALS['content']['struct'][$key]["acat_redirect"], ' ''', ''','','');

original code is:
$redirect = get_redirect_link($GLOBALS['content']['struct'][$key]["acat_redirect"], ' ', '');


so, either you or your editor does something wrong here
---------------------------------------
as I said it's not possible to sort the structure in alphabetical order AND then move the items up and down.
I don't quite see the sense here.
You can not expect from the code to figure out when you want to add which sort order, it's either alphabetically or by sortnumber in db
gruss / regards
breitsch
breitsch
 
Posts: 304
Joined: Sun Mar 06, 2005 22:12
Location: bern switzerland


Return to hacks & enhancements

Who is online

Users browsing this forum: Alexa [Bot], Yahoo [Bot] and 0 guests