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.
Post Reply
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Any core hack hor arange category ?

Post by culda_a »

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

http://forum.phpwcms.org/viewtopic.php? ... 05#p113205
ImagePackging design,labels, catalogs,postcards,
breitsch
Posts: 473
Joined: Sun 6. Mar 2005, 23:12
Location: bern switzerland

Re: Any core hack hor arange category ?

Post by breitsch »

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.
http://www.youtube.com/watch?v=jqxENMKaeCU
because it's important!
breitsch
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Re: Any core hack hor arange category ?

Post by culda_a »

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

Re: Any core hack hor arange category ?

Post by culda_a »

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: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Re: Any core hack hor arange category ?

Post by culda_a »

also I see that I can not add anymore no category in the structure.
ImagePackging design,labels, catalogs,postcards,
breitsch
Posts: 473
Joined: Sun 6. Mar 2005, 23:12
Location: bern switzerland

Re: Any core hack hor arange category ?

Post by breitsch »

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.
http://www.youtube.com/watch?v=jqxENMKaeCU
because it's important!
breitsch
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Re: Any core hack hor arange category ?

Post by culda_a »

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: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Re: Any core hack hor arange category ?

Post by culda_a »

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,
breitsch
Posts: 473
Joined: Sun 6. Mar 2005, 23:12
Location: bern switzerland

Re: Any core hack hor arange category ?

Post by breitsch »

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
http://www.youtube.com/watch?v=jqxENMKaeCU
because it's important!
breitsch
Post Reply