[SOLVED] article content sorting is not correct - dev 1.1.9

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
purnsam
Posts: 12
Joined: Tue 1. Feb 2005, 02:34

[SOLVED] article content sorting is not correct - dev 1.1.9

Post by purnsam »

Hi!

I'm using dev 1.1.9 now and found that article move up/down function is not correct. Please look attached image - compare status bar path and reail content part ID.

Is this bug?

Here is image.

Image
real ID = 38 and 42, status path = 38 and 47


Image
real ID = 38 and 43, status path = 38 and 39

Regards,
rushclub
Posts: 915
Joined: Tue 17. Feb 2004, 18:52

Post by rushclub »

do you have set the right sortation in the admin area. there you have different possibilities to sort different categories. take a look in there. you have to set the categorie to »manual (arrow up/down)«

cheers
rush
3 (!) Jahre warten reichen mir. Ich bin erst mal weg.
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

do you use content anywhere?

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
purnsam
Posts: 12
Joined: Tue 1. Feb 2005, 02:34

manual arrow up/down is already set.

Post by purnsam »

rushclub wrote:do you have set the right sortation in the admin area. there you have different possibilities to sort different categories. take a look in there. you have to set the categorie to »manual (arrow up/down)«

cheers
rush
yes. manual arrow up/down is already set.
purnsam
Posts: 12
Joined: Tue 1. Feb 2005, 02:34

I use content anywhere

Post by purnsam »

Oliver Georgi wrote:do you use content anywhere?

Oliver
When I use content anywhere, this sorting problem happens.
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

OK, what I thought - is not really a sorting problem.

It always sorts all content parts - including the one selected for content anywhere. Will be changed later.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
purnsam
Posts: 12
Joined: Tue 1. Feb 2005, 02:34

Found answer!

Post by purnsam »

Oliver Georgi wrote:OK, what I thought - is not really a sorting problem.

It always sorts all content parts - including the one selected for content anywhere. Will be changed later.

Oliver
According to your advice, I changed include/inc_tmpl/articlecontent.list.tmpl.php

line 162

from
" ORDER BY acontent_sorting, acontent_id;";

to

" ORDER BY acontent_block, acontent_sorting, acontent_id;";

Not, it's solved.

Thanks for your advice, Oliver.
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

hey thanks, that solves part 1 ;-)

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Ok you have forced me to do the rest too ;-)

In include/inc_tmpl/articlecontent.list.tmpl.php starting at line 160 change as follow and ending above this line of comment:

Code: Select all

//Listing zugehöriger Artikel Content Teile

Code: Select all

			$sql  = "SELECT acontent_id, acontent_sorting, acontent_trash, acontent_block FROM ".DB_PREPEND."phpwcms_articlecontent ";
			$sql .= "WHERE acontent_aid=".$article["article_id"]." ORDER BY acontent_block, acontent_sorting, acontent_id";
			if($result = mysql_query($sql, $db) or die("error while listing contents for this article")) {
				$sc = 0; $scc = 0; //Sort-Zwischenzähler
				while($row = mysql_fetch_row($result)) {
					$scc++;
					if($row[2] == 0) {
						$sc++;
						$sbutton[$sc]["id"]    = $row[0];
						$sbutton[$sc]["sort"]  = $row[1];
						$sbutton[$sc]["block"] = $row[3];
					}
				}
			}
			if($sc) {
				//Jetzt aufbauen der Sortieranweisung
				foreach($sbutton as $key => $value) {
					if($key == 1) {
						// if 1st content part in list
						$sbutton[$key]["top"] = "<img src=\"img/button/sort_top_0.gif\" border=\"0\">";
						
					} elseif(isset($sbutton[$key-1]["block"]) && $sbutton[$key-1]["block"] != $sbutton[$key]["block"]) {
						// if this content part is selected for different block than previous
						$sbutton[$key]["top"] = "<img src=\"img/button/sort_top_0.gif\" border=\"0\">";
						
					} else {
						$sbutton[$key]["top"] = "<a href=\"include/inc_act/act_articlecontent.php?sort=".
						$sbutton[$key]["id"].":".$sbutton[$key-1]["sort"]."|".
						$sbutton[$key-1]["id"].":".$sbutton[$key]["sort"].
						"\" title=\"".$BL['be_article_cnt_up']."\"><img src=\"img/button/sort_top_1.gif\" border=\"0\"></a>";
					}
					if($key == $sc) {
						// if this is the last content part in list
						$sbutton[$key]["bottom"] = "<img src=\"img/button/sort_bottom_0.gif\" border=\"0\">";
					
					} elseif(isset($sbutton[$key+1]["block"]) && $sbutton[$key+1]["block"] != $sbutton[$key]["block"]) {
						// if this is the last content part in current block and next is different
						$sbutton[$key]["bottom"] = "<img src=\"img/button/sort_bottom_0.gif\" border=\"0\">";
					
					} else {
						$sbutton[$key]["bottom"] = "<a href=\"include/inc_act/act_articlecontent.php?sort=".
						$sbutton[$key]["id"].":".$sbutton[$key+1]["sort"]."|".
						$sbutton[$key+1]["id"].":".$sbutton[$key]["sort"].
						"\" title=\"".$BL['be_article_cnt_down']."\"><img src=\"img/button/sort_bottom_1.gif\" border=\"0\"></a>";
					}
					$sbutton_string[$sbutton[$key]["id"]] = $sbutton[$key]["top"].
					"<img src=\"img/leer.gif\" width=\"1\" height=\"1\">".
					$sbutton[$key]["bottom"];
				}
				unset($sbutton);
			}
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
purnsam
Posts: 12
Joined: Tue 1. Feb 2005, 02:34

Perfect!!!

Post by purnsam »

Thanks! Oliver.

Now, sorting in block is perfect. :D
Post Reply