Author Topic: [Mod] Show Search link in Member profile page, "Total Images"  (Read 5524 times)

0 Members and 1 Guest are viewing this topic.

Rembrandt

  • Guest
Hi!

This Modification count all Images from a user and display the result in the Member profile page as search link.

The desire for this Modification comes from here: http://www.4homepages.de/forum/index.php?topic=30694.0

1.) search in member.php:

      $user_email_button 
REPLACE_EMPTY;
    }

insert below:

 
//############# Start Search link in Member profile page, "Total Images" ############
    
$sql "SELECT COUNT(image_id) AS sum_images
            FROM "
.IMAGES_TABLE."
            WHERE image_active = 1  AND user_id = "
.$user_row['user_id']."
            "
;
    
$sum_images $site_db->query_firstrow($sql);
//############## End Search link in Member profile page, "Total Images" ##############

1.2) search:

    $site_template
->register_vars(array(
      
"user_id" => $user_row['user_id'],

and replace:

    $site_template
->register_vars(array(
    
//############## Start Search link in Member profile page, "how many Images" ############
      
"count_user_images" => "<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_user=".urlencode($user_row['user_name']))."\">".$sum_images['sum_images']."</a>",    
      
"lang_count_image" => $lang['count_image'],
    
//############## End Search link in Member profile page, "how many Images" ############     
      
"user_id" => $user_row['user_id'],


2.) search in lang/your lang/main.php "?>" and insert above:
(deutsch)

$lang
['count_image']  = "Bilder Gesamt:";

(english)

$lang
['count_image']  = "Total Images:";


3.) search in templates/your templates/member_profile.html
Code: [Select]
        <tr>
          <td class="row1"><b>{lang_join_date}</b></td>
          <td class="row1">{user_join_date}</td>
        </tr>
and insert above, or where ever you want:
Code: [Select]
        <tr>
          <td class="row2"><b>{lang_count_image}</b></td>
          <td class="row2">{count_user_images}</td>
        </tr>

mfg Andi