Author Topic: More fields in keywords  (Read 12822 times)

0 Members and 1 Guest are viewing this topic.

Offline luktur

  • Newbie
  • *
  • Posts: 38
    • View Profile
More fields in keywords
« on: September 21, 2013, 10:11:17 PM »
Hi. I have question. It is possible to have couple keywords fields in upload image?

1. User write in fields:



2. All data are in one kywords:

Rembrandt

  • Guest
Re: More fields in keywords
« Reply #1 on: September 22, 2013, 06:32:49 PM »
Hi!

1.) search in your Template/member_uploadform.html:
Code: [Select]
         <tr>
            <td class="row2" valign="top"><b>{lang_keywords}</b></td>
            <td class="row2">
              <textarea cols="30" class="textarea" rows="10" name="image_keywords">{image_keywords}</textarea>
            </td>
          </tr>
and replace:
Code: [Select]
         <tr>
            <td class="row2" valign="top"><b>{lang_keywords}</b></td>
            <td class="row2">
              <textarea cols="30" class="textarea" rows="10" name="image_keywords0">{image_keywords0}</textarea>
            </td>
          </tr>
          <tr>
            <td class="row2" valign="top"><b>1 {lang_keywords}</b></td>
            <td class="row2">
              <textarea cols="30" class="textarea" rows="10" name="image_keywords1">{image_keywords1}</textarea>
            </td>
          </tr>
          <tr>
            <td class="row2" valign="top"><b>2 {lang_keywords}</b></td>
            <td class="row2">
              <textarea cols="30" class="textarea" rows="10" name="image_keywords2">{image_keywords2}</textarea>
            </td>
          </tr>

2.) search in member.php section ($action == "uploadimage)":

  $image_keywords 
un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords']));

  
$image_keywords preg_replace("/[\n\r]/is"","$image_keywords);
  
$image_keywords_arr explode(','$image_keywords);
  
array_walk($image_keywords_arr'trim_value');
  
$image_keywords implode(','array_unique(array_filter($image_keywords_arr)));

and replace:

  
function image_keywords($image_keywords){
    
$image_keywords preg_replace("/[\n\r]/is"","$image_keywords);
    
$image_keywords_arr explode(','$image_keywords);
    
array_walk($image_keywords_arr'trim_value');
    
$image_keywords implode(','array_unique(array_filter($image_keywords_arr)));
    return 
$image_keywords;
  }

  
$image_keywords0 un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords0']));
  
$image_keywords1 un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords1']));
  
$image_keywords2 un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords2']));

  
$image_keywords0 image_keywords($image_keywords0);
  
$image_keywords1 image_keywords($image_keywords1);
  
$image_keywords2 image_keywords($image_keywords2);

  
$image_keywords $image_keywords0.",".$image_keywords1.",".$image_keywords2;
  
$image_keywords image_keywords($image_keywords);


2.1) search:

"image_keywords" => format_text(stripslashes($image_keywords), 2),

and replace:

    
"image_keywords0" => format_text(stripslashes($image_keywords0), 2),
    
"image_keywords1" => format_text(stripslashes($image_keywords1), 2),
    
"image_keywords2" => format_text(stripslashes($image_keywords2), 2),


mfg Andi
« Last Edit: September 26, 2013, 05:48:46 AM by Rembrandt »

Offline Pawel_el

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: More fields in keywords
« Reply #2 on: September 26, 2013, 12:29:23 AM »
It does not work. Task # 2 for
improvement.

Rembrandt

  • Guest
Re: More fields in keywords
« Reply #3 on: September 26, 2013, 05:48:28 AM »

i have edit Step 2.),  all changes in section ($action == "uploadimage")

Offline luktur

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: More fields in keywords
« Reply #4 on: September 27, 2013, 09:20:21 PM »
In member.php I should have:

$image_keywords un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords']));

  
$image_keywords preg_replace("/[\n\r]/is"","$image_keywords);
  
$image_keywords_arr explode(','$image_keywords);
  
array_walk($image_keywords_arr'trim_value');
  
$image_keywords implode(','array_unique(array_filter($image_keywords_arr)));


but I have only in section upload:

  $image_keywords un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords']));
  
$image_keywords preg_replace("/[\n\r]/is"" "$image_keywords);
  
$image_keywords str_replace(","," ",$image_keywords);
  
$image_keywords ereg_replace("( ){2,}"" "$image_keywords);


Also if I upload image I have errors:

Code: [Select]
Warning: array_walk() [function.array-walk]: Unable to call trim_value() - function does not exist in /home/michall/domains/ogk.test.cal.pl/public_html/member.php on line 500

Warning: array_walk() [function.array-walk]: Unable to call trim_value() - function does not exist in /home/michall/domains/ogk.test.cal.pl/public_html/member.php on line 500

Warning: array_walk() [function.array-walk]: Unable to call trim_value() - function does not exist in /home/michall/domains/ogk.test.cal.pl/public_html/member.php on line 500

Warning: array_walk() [function.array-walk]: Unable to call trim_value() - function does not exist in /home/michall/domains/ogk.test.cal.pl/public_html/member.php on line 500

But keywords are visible. Problem is with ,

EU07,EU07-102,D29-143

It should be:

EU07 EU07-102 D29-143

Rembrandt

  • Guest
Re: More fields in keywords
« Reply #5 on: September 28, 2013, 05:48:40 AM »
....
Also if I upload image I have errors:...
Your 4images Version is to old

try this, search in step 2.):

function image_keywords($image_keywords){
    
$image_keywords preg_replace("/[\n\r]/is"","$image_keywords);
    
$image_keywords_arr explode(','$image_keywords);
    
array_walk($image_keywords_arr'trim_value');
    
$image_keywords implode(','array_unique(array_filter($image_keywords_arr)));
    return 
$image_keywords;
  }

and repalce:

function image_keywords($image_keywords){
  
$image_keywords un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords']));
  
$image_keywords preg_replace("/[\n\r]/is"" "$image_keywords);
  
$image_keywords str_replace(","," ",$image_keywords);
  
$image_keywords ereg_replace("( ){2,}"" "$image_keywords);
    return 
$image_keywords;
  }

Offline luktur

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: More fields in keywords
« Reply #6 on: September 28, 2013, 04:13:50 PM »
....
Also if I upload image I have errors:...
Your 4images Version is to old



So am I ;)

Now I don't have keywords :(

My versrion 1.76

Offline luktur

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: More fields in keywords
« Reply #7 on: January 06, 2014, 10:28:52 PM »
In my version 1.7.6 I have in member.php:

  $image_keywords un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords']));
  
$image_keywords preg_replace("/[\n\r]/is"" "$image_keywords);
  
$image_keywords str_replace(","," ",$image_keywords);
  
$image_keywords ereg_replace("( ){2,}"" "$image_keywords);


I should have this thing to have mod:

$image_keywords un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords']));

  
$image_keywords preg_replace("/[\n\r]/is"","$image_keywords);
  
$image_keywords_arr explode(','$image_keywords);
  
array_walk($image_keywords_arr'trim_value');
  
$image_keywords implode(','array_unique(array_filter($image_keywords_arr)));


Today I solve the problem:

I change code from 1.7.6:

$image_keywords un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords']));
  
$image_keywords preg_replace("/[\n\r]/is"" "$image_keywords);
  
$image_keywords str_replace(","," ",$image_keywords);
  
$image_keywords ereg_replace("( ){2,}"" "$image_keywords);


to MOD code:

function image_keywords($image_keywords){
    
$image_keywords preg_replace("/[\n\r]/is"","$image_keywords);
    
$image_keywords_arr explode(','$image_keywords);
    
array_walk($image_keywords_arr'trim_value');
    
$image_keywords implode(','array_unique(array_filter($image_keywords_arr)));
    return 
$image_keywords;
  }

  
$image_keywords0 un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords0']));
  
$image_keywords1 un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords1']));
  
$image_keywords2 un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords2']));

  
$image_keywords0 image_keywords($image_keywords0);
  
$image_keywords1 image_keywords($image_keywords1);
  
$image_keywords2 image_keywords($image_keywords2);

  
$image_keywords $image_keywords0.",".$image_keywords1.",".$image_keywords2;
  
$image_keywords image_keywords($image_keywords);


Now I have no errors and MOD is working. But I have little problems with keywords:

EU07,EU07-102,D29-143

It should be:

EU07 EU07-102 D29-143