• [Mod] Let visitors to chose how to sort images(date,name,..) 5 0 5 1
Currently:  

Author Topic: [Mod] Let visitors to chose how to sort images(date,name,..)  (Read 181818 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
[Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #30 on: March 12, 2003, 02:33:43 PM »
Programming is like that sometimes.  :wink:

Offline dirk1968de

  • Pre-Newbie
  • Posts: 4
    • View Profile
[Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #31 on: March 23, 2003, 05:05:54 PM »
Hallo,

ich habe meine Galerie, wie im zweiten Beitrag beschrieben geändert. Nur kann ich keine Veränderung feststellen.

Meine Frage: Was muss ich denn jetzt noch machen?

Da ich die englische Sprache nicht beherrsche, kann ich mit den nachfolgenden Beiträgen in diesem Thread leider nichts anfangen. Kann mir denn jemand weiterhelfen?

Gruß Dirk

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Cookies based
« Reply #32 on: March 25, 2003, 01:54:17 PM »
If u want use cookies do following changes:

In the original code in the step 1.3. replace:
Code: [Select]
//-----------------------------------------------------
//--- Set Images Sort ---------------------------------
//----original script is 'Setperpage'. but it doesnt work if uncoment those two lines below ):
//----Maybe someone knows why? (;---------
//-----------------------------------------------------
if (isset($HTTP_POST_VARS['imagesorder'])) {
//  $imagesorder = intval($HTTP_POST_VARS['imagesorder']); //I dont understand why when this line uncoment, the script doesnt work?
  $imagesorder = $HTTP_POST_VARS['imagesorder']; //Added 03-11-2003
  if ($imagesorder) {
    $site_sess->set_session_var("imgs_order", $imagesorder);
    $session_info['imgs_order'] = $imagesorder;
  }
}

if (isset($session_info['imgs_order'])) {
  $config['image_order'] = $session_info['imgs_order'];
}

if (isset($HTTP_POST_VARS['imagessort'])) {
// $imagessort = intval($HTTP_POST_VARS['imagessort']);
$imagessort = $HTTP_POST_VARS['imagessort']; //Added 03-11-2003
  if ($imagessort) {
    $site_sess->set_session_var("imgs_sort", $imagessort);
    $session_info['imgs_sort'] = $imagessort;
  }
}

if (isset($session_info['imgs_sort'])) {
  $config['image_sort'] = $session_info['imgs_sort'];
}
//----End Images Sort----------------------------------

with this:
Code: [Select]
//-----------------------------------------------------
//--- Set Images Sort ---------------------------------
//-----------------------------------------------------
if (isset($HTTP_POST_VARS['imagesorder'])) {
  $imagesorder = $HTTP_POST_VARS['imagesorder'];
  if ($imagesorder) {
    $site_sess->set_session_var("imgs_order", $imagesorder);
    $session_info['imgs_order'] = $imagesorder;
  }
}
$cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME : "4images_";
$cookie_order = isset($HTTP_COOKIE_VARS[$cookie_name.'imgs_order']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'imgs_order'])) : $config['image_order'];
$config['image_order'] = (isset($session_info['imgs_order'])) ? $session_info['imgs_order'] : $cookie_order;
$cookie_expire = time() + 60 * 60 * 24 * 90;
setcookie($cookie_name.'imgs_order', serialize($config['image_order']), $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);

if (isset($HTTP_POST_VARS['imagessort'])) {
$imagessort = $HTTP_POST_VARS['imagessort'];
  if ($imagessort) {
    $site_sess->set_session_var("imgs_sort", $imagessort);
    $session_info['imgs_sort'] = $imagessort;
  }
}

$cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME : "4images_";
$cookie_sort = isset($HTTP_COOKIE_VARS[$cookie_name.'imgs_sort']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'imgs_sort'])) : $config['image_sort'];
$config['image_sort'] = (isset($session_info['imgs_sort'])) ? $session_info['imgs_sort'] : $cookie_sort;
$cookie_expire = time() + 60 * 60 * 24 * 90;
setcookie($cookie_name.'imgs_sort', serialize($config['image_sort']), $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);
//----End Images Sort----------------------------------
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline pleo

  • Pre-Newbie
  • Posts: 8
    • View Profile
little help?
« Reply #33 on: May 28, 2003, 02:49:07 AM »
hi, i seem to be having a little problem with this, not sure why.  i followed the instructions and then i inserted this into category.html:
Code: [Select]
<tr>
                          <td width="80%">
                          <p align="right">{imgsort_dropdown_form}</td>
                          <td width="20%">
                          <p align="right">{upload_button}</td>
                        </tr>

but the drop down menu is not showing correctly, and i'm not sure why.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: little help?
« Reply #34 on: May 28, 2003, 02:58:36 AM »
Quote from: pleo
but the drop down menu is not showing correctly, and i'm not sure why.

Please be more specific, what doesnt work? not showing correctly? what does it show? also, if u could post a link or something, could be usefull too.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline pleo

  • Pre-Newbie
  • Posts: 8
    • View Profile
sorry
« Reply #35 on: May 28, 2003, 03:01:20 AM »
alright i'm not sure how to be more specific in words.  you can see what is happening here http://www.net-x.org/img

go to a category and look next to the "upload" button at the top. that is where the code has been inserted but all i get is a wierd little button,  thanks

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #36 on: May 28, 2003, 03:06:58 AM »
ok, that was enough ;)
btw, I've never seen anything like that!
did u look at your page source code? it's pretty much....wierd...
not sure what do u use to edit .php files, or maybe it cause by something else, but the code showed with spaces between each letter!
Code: [Select]
                        <td width="80%">
                          <p align="right">&#1103;&#1102;< T A B L E   b o r d e r = " 0 "   c e l l s p a c i n g = " 0 "   c e l l p a d d i n g = " 0 " >  
         < F O R M   m e t h o d = " p o s t "   a c t i o n = "  " >  
                 < T R >  
                         < T D   n o w r a p >  & n b s p ; < / T D >  
                         < T D   n o w r a p >  
                                  & n b s p ;  
                                 < I N P U T   t y p e = " s u b m i t "   v a l u e = "  "   c l a s s = " b u t t o n "   n a m e = " s u b m i t "   / > < / T D >  
                 < / T R >  
         < / F O R M >  
 < / T A B L E > </td>
                          <td width="20%">
                          <p align="right"><img src="./templates/4dark/images/upload_off.gif" border="0" alt="" /></td>

so, hopefuly u did backup before u started do changes, restore what u did and try again...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline pleo

  • Pre-Newbie
  • Posts: 8
    • View Profile
wierd
« Reply #37 on: May 28, 2003, 03:19:58 AM »
wierd!  something funky was going on...thanks for noticing that.  all fixed now and working lovely!!

Offline artpapa

  • Newbie
  • *
  • Posts: 31
    • View Profile
[Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #38 on: June 01, 2003, 01:28:57 AM »
Hi  V@no.
I trying to install this mod, but it giving me "404 Error - File Not Found" with the this address:
http://www.artpapa.com/gallery/lang/english/%7Bself%7D

sorry I cannot describe that  better.

tx
Alexei

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #39 on: June 01, 2003, 01:34:52 AM »
Quote from: artpapa
http://www.artpapa.com/gallery/lang/english/%7Bself%7D

seems to me u are using Macromedia Dreamweaver to edit files...
open again files u edited and replace all %7B and %7D with { and }
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline artpapa

  • Newbie
  • *
  • Posts: 31
    • View Profile
[Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #40 on: June 01, 2003, 03:53:05 AM »
thank you  
I find change only in the imgsort_dropdown_form.html, and make changes in the notepad as you provide in the mod instruction.
it is start work in the categories, but didn't work in the home template, I mean after reloading nothing is change. (Should it work in the home?).
what editor do you recommend?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #41 on: June 01, 2003, 04:15:52 AM »
Quote from: artpapa
it is start work in the categories, but didn't work in the home template, I mean after reloading nothing is change. (Should it work in the home?).
U must add exact same code in any templates where u want it be displayed.

Quote from: artpapa
what editor do you recommend?
Dreamweaver is very good editor, that "thing" doesnt happend all the time (atleast for me), it happend just ones in last 9 month I use it...
also, I have asked that question long time ago too ;):
http://www.4homepages.de/forum/viewtopic.php?t=1901
since then I use Ultraedit with absolutely no prblems, and I love it.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline artpapa

  • Newbie
  • *
  • Posts: 31
    • View Profile
[Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #42 on: June 01, 2003, 04:42:35 AM »
Quote from: V@no
Quote from: artpapa
it is start work in the categories, but didn't work in the home template, I mean after reloading nothing is change. (Should it work in the home?).
U must add exact same code in any templates where u want it be displayed.


Thanks, I did {imgsort_dropdown_form}, bad pictures still in the same order.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #43 on: June 01, 2003, 04:54:20 AM »
what version of the MOD do u use? regular or with using cookies?
also, what do u mean "didnt work in the home template"? when u open index.php it shows u new images that being sorted by date, this MOD has no affect of "new images" part.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline artpapa

  • Newbie
  • *
  • Posts: 31
    • View Profile
[Mod] Let visitors to chose how to sort images(date,name,..)
« Reply #44 on: June 01, 2003, 05:31:05 AM »
Quote from: V@no
what version of the MOD do u use? regular or with using cookies?.

for some reason I change for cookies while trying to figure out, is their any difference?

Quote from: V@no
this MOD has no affect of "new images" part.

I see, that mean not in the home.html template.

thanks a lot......