4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: nagmat on July 12, 2010, 04:09:37 AM
-
I Want Mods or Plugins To Stick Images
For 4images 1.7.7
-
This mod will show selected images first in the category no matter what sorting is selected, aka make images "pinned" or "sticky"
Demo: http://4images.vano.org/ajaxcomments/categories.php?cat_id=4 (option "Show "sticky" media first" option on the left)
1) add new field into 4images_images table (use phpmyadmin or similar)
ALTER TABLE 4images_images ADD image_sticky TINYINT( 1 ) UNSIGNED NOT NULL
or download attached install_pin_images.php file, upload it to your 4images root directory and executed it. (thanks to Rembrandt for the installer)
2) add this line in includes/db_field_definitions.php (refer to this topic for more: [TUT] Zusätzliches Image Feld anlegen / Additional Image Field (http://www.4homepages.de/forum/index.php?topic=20748.0) and how to make it multilanguage)
$additional_image_fields['image_sticky'] = array("Sticky", "radio");
3) in categories.php find:
ORDER BY ".$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."
Replace with:
ORDER BY i.image_sticky DESC, ".$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."
4) in details.php find three times:
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
Replace all of them with:
ORDER BY image_sticky DESC, ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
5) edit an image in ACP (Admin Control Panel) you should see a new radio button "Sticky"
6) if you would like display an icon for sticky images, edit thumbnail_bit.html template and add something similar to this:
{if image_sticky}
<img src="{template_image_url}/pin.gif" style="float: right;" border="0">
{endif image_sticky}
(assuming you already have (http://www.4homepages.de/forum/index.php?action=dlattach;topic=27527.0;attach=5607;image) in templates/<your template>/images/ directory)
-
Streaming Experience
-
I done all but when stick file
dont sticky
-
Worked in my tests just fine.
-
Worked in my tests just fine.
seconed file are sticky from admincp
but is the seconed
http://nagmat.com/cat-%D9%86%D8%BA%D9%85%D8%A7%D8%AA-%D8%B9%D9%85%D8%B1%D9%88-%D8%AF%D9%8A%D8%A7%D8%A8-3.htm
And why
1) add new field into 4images_images table (use phpmyadmin or similar)
because I am add this but not Sure from this
-
that is how it supposed to look like:
(http://img337.imageshack.us/img337/2696/stickyp.png)
Also, when you edit your "sticky" image, does it automatically select "yes" sticky option?
-
that is how it supposed to look like:
(http://img337.imageshack.us/img337/2696/stickyp.png)
Also, when you edit your "sticky" image, does it automatically select "yes" sticky option?
why does it automatically select "yes" sticky option?
-
because you said you set to "yes"..
-
because you said you set to "yes"..
No No Iam said to you Iam Edit File of Mp3 In 4images admincp to sticky
you get me wrong
Thank you For your helping
and i wait you ............
-
Sorry, I have no idea what you are talking about...
Login as administrator, go to a category, click on the last image on the page, on image details page click edit link under the image, then at the bottom of the opened page set option "Sticky" to "yes", hit save button, now go to that category again, that image should be first now.
Here is a demo:
http://4images.vano.org/ajaxcomments/categories.php?cat_id=4
(you can play with the settings on left)
-
This Modification work perfectly.
Installer Added (attachment).
Thread titel adapted...
@V@no, can you say how the gifs (Stickys) be made in the thumbnails? :)
mfg Andi
-
Was genau macht dieser Mod?
-
Was genau macht dieser Mod?
in der category.html, egal welche sortierung du hast, die bilder die gepinnt sind werden zuerst angezeigt.
das solltest du eigentlich schon aus dem code herraus sehn können :)
auf V@nos demo page siehst du es auch..
mfg Andi
-
Achso, dass ist ja interessant! :D
-
This Modification work perfectly.
Installer Added (attachment).
Thread titel adapted...
@V@no, can you say how the gifs (Stickys) be made in the thumbnails? :)
mfg Andi
Thank you for the installer.
I've added step 6 for the template.
-
..
....Thank you for the installer.
I've added step 6 for the template.
i thank you ,for the cool stuff :)