4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: nagmat on July 12, 2010, 04:09:37 AM

Title: [Mod] Pinned Images
Post by: nagmat on July 12, 2010, 04:09:37 AM
I Want Mods or Plugins To Stick Images

For 4images 1.7.7
Title: Re: I Want Mods or Plugins To Stick Images
Post by: V@no on July 12, 2010, 04:36:53 AM
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)
Code: [Select]
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:
Code: [Select]
       ORDER BY ".$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."Replace with:
Code: [Select]
       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:
Code: [Select]
         ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort'];
Replace all of them with:
Code: [Select]
         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:
Code: [Select]
{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)
Title: Re: I Want Mods or Plugins To Stick Images
Post by: nagmat on July 12, 2010, 06:50:39 AM
Streaming Experience
Title: Re: I Want Mods or Plugins To Stick Images
Post by: nagmat on July 13, 2010, 01:55:54 PM
I done all but when stick file

dont sticky
Title: Re: I Want Mods or Plugins To Stick Images
Post by: V@no on July 13, 2010, 02:11:31 PM
Worked in my tests just fine.
Title: Re: I Want Mods or Plugins To Stick Images
Post by: nagmat on July 13, 2010, 02:44:52 PM
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
Title: Re: I Want Mods or Plugins To Stick Images
Post by: V@no on July 13, 2010, 03:03:44 PM
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?
Title: Re: I Want Mods or Plugins To Stick Images
Post by: nagmat on July 13, 2010, 03:44:13 PM
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?
Title: Re: I Want Mods or Plugins To Stick Images
Post by: V@no on July 13, 2010, 04:19:19 PM
because you said you set to "yes"..
Title: Re: I Want Mods or Plugins To Stick Images
Post by: nagmat on July 14, 2010, 01:58:12 AM
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 ............
Title: Re: I Want Mods or Plugins To Stick Images
Post by: V@no on July 14, 2010, 02:41:53 AM
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)
Title: Re: I Want Mods or Plugins To Stick Images
Post by: Rembrandt on July 15, 2010, 08:32:21 AM
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
Title: Re: [Mod] Stick Images
Post by: Sunny C. on July 15, 2010, 09:44:27 AM
Was genau macht dieser Mod?
Title: Re: [Mod] Stick Images
Post by: Rembrandt on July 15, 2010, 11:56:04 AM
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
Title: Re: [Mod] Stick Images
Post by: Sunny C. on July 15, 2010, 01:09:50 PM
Achso, dass ist ja interessant! :D
Title: Re: [Mod] Pinned Images
Post by: V@no on July 15, 2010, 02:50:00 PM
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.
Title: Re: [Mod] Pinned Images
Post by: Rembrandt on July 15, 2010, 02:56:32 PM
..
....Thank you for the installer.
I've added step 6 for the template.

i thank you ,for the cool stuff :)