4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: dosensteck on October 23, 2005, 02:57:29 PM
-
NOT MY MOD, FOUND IN GOOGLE CACHE! NO SUPPORT!
Mod Author: rproctor
PAGING PROBLEM GELÖST
You can go hee to my test site which I mess with code and what not. This is a direct link to a main category which has the master_cat turned on and this mod installed.
http://www.digitalgod.biz/test/categories.php?cat_id=4
I needed a way to better organize my categories. I didnt want my main categories to have any submissions, only my sub categories, but it looks so ugly when you view a main category and it says 0 images found. So, instead with a few tweeks, I made categories that I selected display the images of the subcategories.
The downfall is that if you select a category to display subcat images, it will only display FIRST LEVEL sub cat images. Also, if you upload an image where it is specified to show sub cat images, the image will now show up in the category, this is why you should only upload to sub cats that are not checked to disply subcat images. However, you can check sub cats to display sub cat images if that sub cat has a sub cat. Sub cat main cat blue cat green cat... Confused yet? Wink
1) First thing to do is create a field in the CATEGORIES_TABLE using a program like PHPMyAdmin. This field should be named cat_master and a type of tinyint(1), not null, and 0 for default.
2) Now, the boring part. Its time to edit the admin category file so that we can edit this field via ACP. Open admin/categories.php and find
$cat_hits = intval(trim($HTTP_POST_VARS['cat_hits']));
Add after
$cat_master = intval(trim($HTTP_POST_VARS['cat_master']));
2.1) find
SET cat_name = '$cat_name', cat_description = '$cat_description', cat_parent_id = $cat_parent_id, cat_hits = $cat_hits, auth_viewcat = $auth_viewcat, auth_viewimage = $auth_viewimage, auth_download = $auth_download, auth_upload = $auth_upload, auth_directupload = $auth_directupload, auth_vote = $auth_vote, auth_sendpostcard = $auth_sendpostcard, auth_readcomment = $auth_readcomment, auth_postcomment = $auth_postcomment
Replace with
SET cat_name = '$cat_name', cat_description = '$cat_description', cat_parent_id = $cat_parent_id, cat_hits = $cat_hits, auth_viewcat = $auth_viewcat, auth_viewimage = $auth_viewimage, auth_download = $auth_download, auth_upload = $auth_upload, auth_directupload = $auth_directupload, auth_vote = $auth_vote, auth_sendpostcard = $auth_sendpostcard, auth_readcomment = $auth_readcomment, auth_postcomment = $auth_postcomment, cat_master = $cat_master
2.2) find
$sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
Replace with
$sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, cat_master
2.3) find
show_input_row($lang['field_hits'], "cat_hits", $result['cat_hits'], 5);
add after
show_radio_row("cat_master", "cat_master", $result['cat_master']);
2.4) find
$sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
Replace with
$sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, cat_master
/
3) Now its time to make it work. Open 4images/categories.php and find
//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
Add right before it
$sql = "SELECT cat_master
FROM ".CATEGORIES_TABLE."
WHERE cat_id = $cat_id";
$master_cat = $site_db->query_firstrow($sql);
3.1) Next find
"cat_name" => htmlspecialchars($cat_cache[$cat_id]['cat_name']),
Change to
"cat_name2" => htmlspecialchars($cat_cache[$cat_id]['cat_name']),
in 4images v1.7.6 find:
"cat_name" => format_text($cat_cache[$cat_id]['cat_name'], 2),
Change to
"cat_name2" => format_text($cat_cache[$cat_id]['cat_name'], 2),
3.2) Find
if (!$num_rows) {
$thumbnails = "";
$msg = $lang['no_images'];
}
Replace with
if (!$num_rows) {
$thumbnails = "";
if ($master_cat['cat_master'] == 1){
$msg = "";
}
else{
$msg = $lang['no_images'];
}
}
3.3) Now find
$site_template->register_vars("thumbnails", $thumbnails);
unset($thumbnails);
Add below
//-----------------------------------------------------
//--- Show Sub Images ---------------------------------
//-----------------------------------------------------
if ($master_cat['cat_master'] == 1){
$sql = "SELECT cat_parent_id
FROM ".CATEGORIES_TABLE."
WHERE cat_parent_id = $cat_id";
$total_subs = $site_db->query($sql);
$num_subs = $site_db->get_numrows($total_subs);
$sql = "SELECT i.image_id, i.cat_id, i.image_active, c.cat_parent_id
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
WHERE i.image_active = 1 AND c.cat_parent_id = $cat_id AND c.cat_id = i.cat_id";
$result2 = $site_db->query($sql);
$num_rows2 = $site_db->get_numrows($result2);
$link_arg = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id);
//include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $perpage, $num_rows2, $link_arg);
$offset = $getpaging->get_offset();
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_parent_id, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND c.cat_parent_id = $cat_id AND c.cat_id = i.cat_id
ORDER BY ".$config['image_order']." ".$config['image_sort']."
LIMIT $offset, $perpage";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
$imgtable_width = ceil((intval($config['image_table_width'])) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
$imgtable_width .= "%";
}
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i.".$key;
}
}
if (!$num_rows) {
$thumbnails = "";
$msg = $lang['no_images'];
}
else {
$thumbnails = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
$count = 0;
$bgcounter = 0;
while ($image_row = $site_db->fetch_array($result)){
if ($count == 0) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
}
$thumbnails .= "<td width=\"".$imgtable_width."\" =\"top\">\n";
show_image($image_row);
$thumbnails .= $site_template->parse_template("thumbnail_bit");
$thumbnails .= "\n</td>\n";
$count++;
if ($count == $config['image_cells']) {
$thumbnails .= "</tr>\n";
$count = 0;
}
} // end while
if ($count > 0) {
$leftover = ($config['image_cells'] - $count);
if ($leftover > 0) {
for ($i = 0; $i < $leftover; $i++){
$thumbnails .= "<td width=\"".$imgtable_width."\">\n \n</td>\n";
}
$thumbnails .= "</tr>\n";
}
}
$thumbnails .= "</table>\n";
} //end else
$site_template->register_vars("thumbnails", $thumbnails);
unset($thumbnails);
}
4) Here is the last and easiest part. Open 4images/templates/<your_template>/categories.php and change {cat_name} to {cat_name2}.
5) Now upload your edited files to your site. Next enter your ACP and select "Edit categories". You should notice a new field under hits called cat_master, change this to yes to enable this mod for that category. Dont forget, if you upload an image to that category and it has cat_master enabled that image will now show, so you should disable uploading for that category.
Thats about it, hope it works ok, I tested my own instructions on a new installation to make sure I did everything right, and it all seems to be ok.
DEMO: http://www.hobby-fotografen.com/categories.php?cat_id=19
ps: sorry for my bad english :/
so, habe das pagingproblem nun doch in den griff bekommen, und der mod funktioniert jetzt einwandfrei (vielleicht nicht sauber gecodet - funzt aber :D)
-
the Link in the TOP is not working and i got this error
----
Warning: mysql_connect(): Access denied for user: 'digital_tester@localhost' (Using password: YES) in /home/digital/public_html/test/includes/db_mysql.php on line 39
DB Error: Could not connect to the database server (localhost, digital_tester).
-
the Link in the TOP is not working and i got this error
----
Warning: mysql_connect(): Access denied for user: 'digital_tester@localhost' (Using password: YES) in /home/digital/public_html/test/includes/db_mysql.php on line 39
DB Error: Could not connect to the database server (localhost, digital_tester).
ist from the originalpost from rproctor - i post a demolink to my site
-
hat vielleicht irgendjemand zeit sich das pagingproblem anzusehen? ich bin leider nicht der hellste in php und schon schwer daran verzweifelt :/
habe mir andere systeme angesehen wie die das machen - leider habe ich dadurch auch keine lösung gefunden :/
-
hat vielleicht irgendjemand zeit sich das pagingproblem anzusehen? ich bin leider nicht der hellste in php und schon schwer daran verzweifelt :/
habe mir andere systeme angesehen wie die das machen - leider habe ich dadurch auch keine lösung gefunden :/
so, habe das pagingproblem nun doch in den griff bekommen, und der mod funktioniert jetzt einwandfrei (vielleicht nicht sauber gecodet - funzt aber :D)
allerdings funktioniert die linkreihenfolge nichtmehr richtig wenn man in der detailpage weiterblättert
-
Hi dosensteck,
seit Tagen versuche ich, diesen Mod zum laufen zu bringen, aber es will nicht funzen. :(
Im ACP erhalte ich beim Klick auf "Kategorien bearbeiten" folgende Fehlermeldung:
Parse error: parse error, unexpected T_STRING in /meinedomain/4images/admin/categories.php on line 513
Der Code sihet so aus (line 513 ist hier die Zeile '$sql = "SELECT cat_name, cat_description,...')
----
if (empty($error)) {
$sql = "UPDATE ".CATEGORIES_TABLE."
$sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, cat_master
show_radio_row("cat_master", "cat_master", $result['cat_master']);
WHERE cat_id = $cat_id";
$result = $site_db->query($sql);
$msg = ($result) ? $lang['cat_edit_success'] : $lang['cat_edit_error'];
$action = "modifycats";
}
else {
$msg .= sprintf("<span class=\"marktext\">%s</span>", $lang['lostfield_error']);
$action = "editcat";
}
}
------
Bei der Ansicht der Cat.-Seiten selbst erhalte ich außerdem den Error:
Parse error: parse error, unexpected '{' in /meinedomain/4images/categories.php on line 128
Der Code sieht so aus (line 128 ist die erste Zeile dieses Abschnittes 'if (....'):
----
if (!$num_rows) {
$thumbnails = "";
if ($master_cat['cat_master'] == 1){
$msg = "";
}
else{
$msg = $lang['no_images'];
}
}
-----
Kannst du oder jemand sonst mir BITTE behilflich sein, kenne mich mit php leider sehr wenig aus und langsam verlier ich die Nerven. ;-)
Grüße
Riser
PS: Alles was ich will, ist die Darstellung der neusten Bilder auf den Cat.-Seiten, d.h. neuste Bilder in der jeweiligen Cat/Subcat. Gibts dafür nicht noch eine einfachere Lösung, müsste doch eigentlich Standart sein, oder?
-
habe den oberen code aktualisiert, jetzt müsste es funktionieren, war mein fehler! sorry für die umstände :(
-
Parse error: parse error, unexpected T_STRING in /meinedomain/4images/admin/categories.php on line 513
Der Code sihet so aus (line 513 ist hier die Zeile '$sql = "SELECT cat_name, cat_description,...')
----
if (empty($error)) {
$sql = "UPDATE ".CATEGORIES_TABLE."
$sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, cat_master
show_radio_row("cat_master", "cat_master", $result['cat_master']);
WHERE cat_id = $cat_id";
$result = $site_db->query($sql);
$msg = ($result) ? $lang['cat_edit_success'] : $lang['cat_edit_error'];
$action = "modifycats";
}
else {
$msg .= sprintf("<span class=\"marktext\">%s</span>", $lang['lostfield_error']);
$action = "editcat";
}
}
the line indicated in red should not be written at this position :roll:
-
ok, the paging works, the sub images show in the main cat
but, when i click a image the next and previous imagelink is not corecct... :?:
has anyone a idea? where is the code fot this part?
-
@dosensteck, scheint jetzt zu funktionieren. Vielen Dank, dass du dir die Mühe gemacht hast, deine Lösung hier nochmal zu posten. Du hast mir einen Riesengefallen getan. Entschuldige bitte mein spätes Reply, bin kurz nach meinem Post in Urlaub gefahren und hab mein Problem daher erstmal beiseite gelegt. Nochmals danke!
Gruß
Riser
PS: Juhuuuu! :D
-
@dosensteck, the previous/next-links work fine on my site but the paging didn't, so I've added one little thing and now it works. Here is what I did:
3.3)Now find
Code:
$site_template->register_vars("thumbnails", $thumbnails);
unset($thumbnails);
Add below
Code:
//-----------------------------------------------------
//--- Show Sub Images ---------------------------------
//-----------------------------------------------------
if ($master_cat['cat_master'] == 1){
$sql = "SELECT cat_parent_id
FROM ".CATEGORIES_TABLE."
WHERE cat_parent_id = $cat_id";
$total_subs = $site_db->query($sql);
$num_subs = $site_db->get_numrows($total_subs);
$sql = "SELECT i.image_id, i.cat_id, i.image_active, c.cat_parent_id
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
WHERE i.image_active = 1 AND c.cat_parent_id = $cat_id AND c.cat_id = i.cat_id";
$result2 = $site_db->query($sql);
$num_rows2 = $site_db->get_numrows($result2);
$link_arg = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id);
//include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $perpage, $num_rows2, $link_arg);
$offset = $getpaging->get_offset();
$site_template->register_vars(array(
"paging" => $getpaging->get_paging(),
"paging_stats" => $getpaging->get_paging_stats()
));
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_parent_id, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND c.cat_parent_id = $cat_id AND c.cat_id = i.cat_id
ORDER BY ".$config['image_order']." ".$config['image_sort']."
LIMIT $offset, $perpage";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
$imgtable_width = ceil((intval($config['image_table_width'])) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
$imgtable_width .= "%";
}
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i.".$key;
}
}
if (!$num_rows) {
$thumbnails = "";
$msg = $lang['no_images'];
}
else {
$thumbnails = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
$count = 0;
$bgcounter = 0;
while ($image_row = $site_db->fetch_array($result)){
if ($count == 0) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
}
$thumbnails .= "<td width=\"".$imgtable_width."\" =\"top\">\n";
show_image($image_row);
$thumbnails .= $site_template->parse_template("thumbnail_bit");
$thumbnails .= "\n</td>\n";
$count++;
if ($count == $config['image_cells']) {
$thumbnails .= "</tr>\n";
$count = 0;
}
} // end while
if ($count > 0) {
$leftover = ($config['image_cells'] - $count);
if ($leftover > 0) {
for ($i = 0; $i < $leftover; $i++){
$thumbnails .= "<td width=\"".$imgtable_width."\">\n \n</td>\n";
}
$thumbnails .= "</tr>\n";
}
}
$thumbnails .= "</table>\n";
} //end else
$site_template->register_vars("thumbnails", $thumbnails);
unset($thumbnails);
}
Everything red is what I've added. That's it, thanks again for the help!
Greetings
Riser
-
just a note.. for this mod to work.. you need to make a database entry..
under the default
4images_categories
make a new field called
name: cat_master
type: tinyint(4)
collation: none
attributes: none
Null: No
Default 0
Extra: none
i did this mod.. and it still didnt work.. so i used the /admin/categories.php from another site, from before the hack, and plugged it in.. worked fine.. there were some other mods done to it, so i dont know if it will work with yours.. but if you want to try mine out.. feel free. im not going to try to figure out what makes this version work, and the other from this mod/page not work. this is also from 1.7.1
-
Got this to work, but i wish to have "cat_master=yes" by default on all categories, how do i do that?
Edit: Solved it myself.
Just changed "Default" to 1 when added the above.
/Thomas
-
That did not work after all. It does the intended and shows the pictures from respective subcategories in main category. BUT, when you check the single subcategories they apear empty.
The problem is solved by changing cat_master to no in the subcategory.
Idea anyone?
(I made a new post because this topic did not move to the first page when i did the previous post)
/Thomas
-
Also ich bekomme es auch nicht zum laufen... Fehlermeldung beim Bearbeiten der Kategorien
Parse error: parse error, unexpected T_STRING in /meinedomain/4images/admin/categories.php on line 645
Ich find es auch mehr als schade, dass für eigentlich eine so selbstverständliche Sache, man ein Mod braucht.
Könnte mir den jemand einbauen ???
Danke
Doreen
-
Is it possible to let the main catogery to have only 9 latest images instead of haviing all images of sub cat
Hope you guys understand and have a Solution
thansk in advance
-
Please!!11
reply
-
Well i've got a little problem with this Mod:
Everything works so far... I can activate the mod at the ACP but i found out, when i insert this code
//-----------------------------------------------------
//--- Show Sub Images ---------------------------------
//-----------------------------------------------------
if ($master_cat['cat_master'] == 1){
$sql = "SELECT cat_parent_id
FROM ".CATEGORIES_TABLE."
WHERE cat_parent_id = $cat_id";
$total_subs = $site_db->query($sql);
$num_subs = $site_db->get_numrows($total_subs);
$sql = "SELECT i.image_id, i.cat_id, i.image_active, c.cat_parent_id
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
WHERE i.image_active = 1 AND c.cat_parent_id = $cat_id AND c.cat_id = i.cat_id";
$result2 = $site_db->query($sql);
$num_rows2 = $site_db->get_numrows($result2);
$link_arg = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id);
//include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $perpage, $num_rows2, $link_arg);
$offset = $getpaging->get_offset();
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_parent_id, c.cat_name".get_user_table_field(", u.", "user_name")."
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND c.cat_parent_id = $cat_id AND c.cat_id = i.cat_id
ORDER BY ".$config['image_order']." ".$config['image_sort']."
LIMIT $offset, $perpage";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
$imgtable_width = ceil((intval($config['image_table_width'])) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
$imgtable_width .= "%";
}
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i.".$key;
}
}
if (!$num_rows) {
$thumbnails = "";
$msg = $lang['no_images'];
}
else {
$thumbnails = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
$count = 0;
$bgcounter = 0;
while ($image_row = $site_db->fetch_array($result)){
if ($count == 0) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
}
$thumbnails .= "<td width=\"".$imgtable_width."\" =\"top\">\n";
show_image($image_row);
$thumbnails .= $site_template->parse_template("thumbnail_bit");
$thumbnails .= "\n</td>\n";
$count++;
if ($count == $config['image_cells']) {
$thumbnails .= "</tr>\n";
$count = 0;
}
} // end while
if ($count > 0) {
$leftover = ($config['image_cells'] - $count);
if ($leftover > 0) {
for ($i = 0; $i < $leftover; $i++){
$thumbnails .= "<td width=\"".$imgtable_width."\">\n \n</td>\n";
}
$thumbnails .= "</tr>\n";
}
}
$thumbnails .= "</table>\n";
} //end else
$site_template->register_vars("thumbnails", $thumbnails);
unset($thumbnails);
}
All my categories are empty.... :cry:
Well i use 4images v. 1.7.2
Someone can help me out??
-
There is a problem with 1.7.3 version (the one I'm using), where it says:
2.3) find
show_input_row($lang['field_hits'], "cat_hits", $result['cat_hits'], 5);
add after
show_radio_row("cat_master", "cat_master", $result['cat_master']);
It should be:
2.3) find
show_input_row($lang['field_hits'], "cat_hits", $result['cat_hits'], 5);
add after
show_radio_row($lang['cat_master'], "cat_master", $cat_row['cat_master']);
At least, that's the only way it works for me using $cat_row['cat_master'] instead of $result['cat_master']. Sorry if I'm wrong...
Please, note that I'm also using the lang atribute (or whatever it is called), so you should add it to your language file in case you want to use it too. If not, just remove the lang atribute from the code I posted. Again, sorry if I missed something.
Regards.
-
Bei mir funktioniert es Perfekt!!!
Allerdings hätte ich noch ein Anliegen:
Wie kann ich auf der Home-Seite auch alle Bilder aller Kategorien anzeigen???
In my case it works perfekt!!!
But I have one extra question:
How can I show all pictures of all categories also on the home site of the gallery???
Nice greetings
F4F
-
I have a problem installing this mod in 1.7.4, when I enable cat_master appear this at the header:
DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_parent_id, c.cat_name, u.user_name FROM fondosimages i, fondoscategories c LEFT JOIN fondosusers u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND c.cat_parent_id = 1 AND c.cat_id = i.cat_id ORDER BY image_name ASC LIMIT 0, 9
Unknown column 'i.user_id' in 'on clause'
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\includes\db_mysql.php on line 116
:|
What im doing wrong?
-
I have a problem installing this mod in 1.7.4, when I enable cat_master appear this at the header:
DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_parent_id, c.cat_name, u.user_name FROM fondosimages i, fondoscategories c LEFT JOIN fondosusers u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND c.cat_parent_id = 1 AND c.cat_id = i.cat_id ORDER BY image_name ASC LIMIT 0, 9
Unknown column 'i.user_id' in 'on clause'
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\includes\db_mysql.php on line 116
:|
What im doing wrong?
Had the same problem, but solved it just replacing:
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
With this:
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
Hope this helps!
Regards.
-
I have a problem installing this mod in 1.7.4, when I enable cat_master appear this at the header:
DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_parent_id, c.cat_name, u.user_name FROM fondosimages i, fondoscategories c LEFT JOIN fondosusers u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND c.cat_parent_id = 1 AND c.cat_id = i.cat_id ORDER BY image_name ASC LIMIT 0, 9
Unknown column 'i.user_id' in 'on clause'
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\includes\db_mysql.php on line 116
:|
What im doing wrong?
Had the same problem, but solved it just replacing:
FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c
With this:
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
Hope this helps!
Regards.
great! now it works perfectly! thanks a lot! i have been a long time trying to fix that :D
-
Now the mod is only showing the newest pics, i cant see the paging :?: I see some replies that seems to speak about that, but dont understand german...
edited: problem solved with this http://www.4homepages.de/forum/index.php?topic=10163.msg54840#msg54840 thanks again :D
-
Unfortunately does not work with 4images 1.7.6... Or I am not right?
-
Any reasons you think it doesn't work? ;)
-
Because I tried to put it...
1) Many PhP-commands are changed (for example
cat_name "=> htmlspecialchars ($cat_cache [$cat_id] [' cat_name '])
). I have corrected them...
2) As a result all the same works nothing. A photo does not show, though numbers of pages are:D
-
Ok ,in your version it's:
"cat_name" => format_text($cat_cache[$cat_id]['cat_name'], 2),
change it to:
"cat_name2" => format_text($cat_cache[$cat_id]['cat_name'], 2),
Anything else? (sorry, I don't have time to check it myself)
-
Yes, I know it. And already corrected by analogy all. But does not work as a result...
-
I'm sorry! :oops: This mod realy work!!!! :roll:
BUT Some questions:
1) If I has subsubcategories, photos therefrom are not shown. Probably to correct it?
2) Can mod show photos from cat_master too? On a level with subcategories?
3) If I change a category on cat_master, and I come once again into options, is shown that cat_master it is not necessary. Each time to come in phpMyAdmin it is inconvenient
4) Whether it is possible to do cat_master at once at category creation?
If somebody answers at least one question, I will be grateful! :wink: Thanks
-
I tried to install this mod (1.7.6) but I get an error message:
DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_parent_id, c.cat_name, u.user_name FROM 4images_images i, 4images_categories c LEFT JOIN 4images_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND c.cat_parent_id = 3 AND c.cat_id = i.cat_id ORDER BY image_date DESC LIMIT 0, 12
Unknown column 'i.user_id' in 'on clause'
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/www/web147/html/littleteam/4images/includes/db_mysql.php on line 116
Has someone an idea what I did wrong?
-
re-do step 3.3
-
Hi,
thanks for the reply :). So far so good, the error-message is gone. But now I have the problem, that in the Control Panel I cannot save the settings for cat_master. Each time I click at "yes" and then onto "safe changes" nothing happens. When I check the settings again "no" is still highlighted :?:
-
Hi,
I'm getting this error
DB Error: Bad SQL Query: SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, cat_master FROM 4images_categories WHERE cat_parent_id = 0 ORDER BY cat_order, cat_name ASC
Unknown column 'cat_master' in 'field list'
-
hi,
you are missing 1st step
1) First thing to do is create a field in the CATEGORIES_TABLE using a program like PHPMyAdmin. This field should be named cat_master and a type of tinyint(1), not null, and 0 for default.
-
Dont forget, if you upload an image to that category and it has cat_master enabled that image will now show, so you should disable uploading for that category.
Kann das mal wer bitte auf Deutsch erklären. Danke!
Warum sollte das Uploading deaktiviert werden?
Update 1: Eine andere Geschichte. Die MOD läuft soweit, bis auf eine kleine Macke:
Über den "Neuesten Fotos" ist das Paging offenbar falsch:
Gefunden: 0 Bild(er) auf 0 Seite(n). Angezeigt: Bild 0 bis 0.
Das ist leider nicht richtig. Von mir aus, müssen diese "paging_stats"
auch nicht über den "Show Sub Images" erscheinen. Jemand ne Idee?
Update 2: So, da fälschlicherweise eine NULL bei mir angezeigt (siehe Update 1),
hab ich mit if und else ein wenig nachgeholfen. Das ist zwar nicht die eleganteste Lösung, aber es funktioniert. :D
Suche in der categories.php
$site_template->register_vars(array(
"paging" => $getpaging->get_paging(),
"paging_stats" => $getpaging->get_paging_stats()
));
...und ersetze es mit
if ($master_cat['cat_master'] == 1) {
$site_template->register_vars(array(
"paging" => $getpaging->get_paging()
));
}
else {
$site_template->register_vars(array(
"paging" => $getpaging->get_paging(),
"paging_stats" => $getpaging->get_paging_stats()
));
}
...so wird diese Statistikzeile nicht angezeigt, wenn wir diese Vorschaubilder (der neuesten Fotos einer Subkategorie) haben.
-
I've found a bug for 1.7.7
If you've changed the cat_master to 1 (on), save the category and you'll come back to edit something in the category, it says "no" in the cat_master field (even if its "yes" in database).
So search:
show_radio_row("cat_master", "cat_master", $result['cat_master']);
and replace it with:
show_radio_row("cat_master", "cat_master", $cat_row['cat_master']);
For me it helps! 8)
-
Hi! This is a great mod!
I think that this code, added by Riser (http://www.4homepages.de/forum/index.php?topic=10163.msg54840#msg54840) should be added in the first post.
$site_template->register_vars(array(
"paging" => $getpaging->get_paging(),
"paging_stats" => $getpaging->get_paging_stats()
));
-
Hello,
I just discover a bug. After installing this mod, you cannot add any category anymore to you galery.
(Version: 1.7.7)
I got this error message:
DB Error: Bad SQL Query: INSERT INTO 4images_categories (cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, cat_password, cat_hide, cat_master) VALUES ('dddd', '', 0, 20, 0, 0, 2, 2, 9, 0, 0, 0, 2, '', 0, )
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 4
Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/*****/******/includes/db_mysql.php:192) in /hsphere/local/home/****/****/includes/functions.php on line 130
Anyone can solve this issue?
Cruxy
-
in the original instructions no changes being made to the INSERT query...maybe you've changes something else by yourself?
-
Thanks V@no for your reply. Actualy I cannot remember that I change something in the code. I don't think so!!!
-
Hi,
is it possible, to show all images from subcategories if i have multiple levels of subcategories?
Example:There is a main category, with two subcategories, each with (sub)subcategories.
All images form the (sub)subcategories should be shown in the above subcategory, all images from the subcategories in the main category.
In the actual mod this only works for 1 level.
Or is there another solution/mod for this (I couldnt find one here)? It´s not necessary to have the possibility to select if a categroy is cat_master or not - i just wan´t to put images in only one category
Thanks for ypur help!
-
Everything works perfect after reading all posts , thanks!
-
Hello there,
just a short question related to this great mod.
is there any solution to limit the number of the shown images (1 or 2 images) from each sub-cat? ( i.e. show only the latest image from a sub-cat)
if so, that would be a great possibility to show a "preview-like-image" as a reference for each sub-cat content.
thanks in advance and cheers
-
this mod works great, followed the replies and got some extra fixes, like the paging. Follow the instructions and you can set this up in less than 10 minutes.