[SOLVED] article content sorting is not correct - dev 1.1.9
[SOLVED] article content sorting is not correct - dev 1.1.9
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.
real ID = 38 and 42, status path = 38 and 47
real ID = 38 and 43, status path = 38 and 39
Regards,
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.
real ID = 38 and 42, status path = 38 and 47
real ID = 38 and 43, status path = 38 and 39
Regards,
- Oliver Georgi
- Site Admin
- Posts: 9906
- Joined: Fri 3. Oct 2003, 22:22
- Contact:
manual arrow up/down is already set.
yes. manual arrow up/down is already set.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
I use content anywhere
When I use content anywhere, this sorting problem happens.Oliver Georgi wrote:do you use content anywhere?
Oliver
- Oliver Georgi
- Site Admin
- Posts: 9906
- Joined: Fri 3. Oct 2003, 22:22
- Contact:
Found answer!
According to your advice, I changed include/inc_tmpl/articlecontent.list.tmpl.phpOliver 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
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.
- Oliver Georgi
- Site Admin
- Posts: 9906
- Joined: Fri 3. Oct 2003, 22:22
- Contact:
- Oliver Georgi
- Site Admin
- Posts: 9906
- Joined: Fri 3. Oct 2003, 22:22
- Contact:
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:
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);
}
Perfect!!!
Thanks! Oliver.
Now, sorting in block is perfect.
Now, sorting in block is perfect.