Items:Profile Image

From SMFShopWiki

Jump to: navigation, search
Profile Image
Latest Item Version: 0.1
SMFShop Version Required: Any
PHP Version Required: Any
MySQL Version Required: Any

This is an item for SMFShop that allows your members to show an image next to their posts. This item comes with a set of flag images, although you can delete the original images and use whatever images you'd like.
Download this item

When the user uses the item, they can choose an image from the selection available:

Then, once they choose, the image is displayed alongside their posts:

[edit] Using the item in other themes

The Profile Image item requires you to edit a template (namely, Display.template.php). If you're using a custom theme, you'll need to do this:
Open Themes/[themename]/Display.template.php (where [themename] is the name of the theme). Find:

  1. if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
  2. echo '
  3. ', $txt[231], ': ', $message['member']['gender']['image'], '<br />';

Add after:

  1. //BEGIN SMFShop Profile Images Item 0.1 Beta
  2. global $db_prefix, $boardurl;
  3. $result_flag = db_query("SELECT shop_Flag
  4. FROM {$db_prefix}members
  5. WHERE ID_MEMBER = {$message['member']['id']}
  6. LIMIT 1", __FILE__, __LINE__);
  7. $row_flag = mysql_fetch_array($result_flag, MYSQL_ASSOC);
  8. if($row_flag['shop_Flag'] !== "")
  9. echo "Flag: <img src='{$boardurl}/Sources/shop/flag_images/{$row_flag['shop_Flag']}'><br />";
  10. //END SMFShop Flag Item
Personal tools