Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 12388
Latest: Rands
New This Month: 5
New This Week: 0
New Today: 0
Stats
Total Posts: 40309
Total Topics: 7100
Most Online Today: 97
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 40
Total: 40

Author Topic: Badges not displaying  (Read 5744 times)

0 Members and 1 Guest are viewing this topic.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15147
    • View Profile
Re: Badges not displaying
« Reply #15 on: July 25, 2015, 03:21:44 pm »
One more time updated code
Code: [Select]
function Badges_DisplayCustomBadges($memberID = 0, $order = 'recent', $maxToShow = 5, $badgesList = array())
{
global $smcFunc, $modSettings, $boardurl;

if (empty($modSettings['badgeawards_enable']))
return;

    if (empty($memberID))
        return; 
       
    if (empty($badgesList))
    {
    return;
    }
       
if (empty($modSettings['badgeawards_url']))
$modSettings['badgeawards_url'] = $boardurl . '/badges/';
       
$badgesCache = array();

$result = $smcFunc['db_query']('', "
SELECT
b.id_badge, b.title, b.image, b.enabled
FROM ({db_prefix}badgeawards_badges as b, {db_prefix}badgeawards_badge_log as l)
WHERE l.id_badge = b.id_badge AND l.ID_MEMBER = $memberID AND b.id_badge IN (" . implode(",",$badgesList) . ")
ORDER BY l.id_log DESC
LIMIT  $maxToShow
");
while ($row = $smcFunc['db_fetch_assoc']($result))
{
$badgesCache[] = $row;

}


if (!empty($badgesCache))
foreach($badgesCache as $row)
{
echo '<img src="' . $modSettings['badgeawards_url']  . $row['image'] . '" alt="' . $row['title'] . '" title="' . $row['title'] . '" /> ';

}


}
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline VapeTech

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: Badges not displaying
« Reply #16 on: July 25, 2015, 03:44:31 pm »
:)  perfect,  is there a way I can use a larger image Badge for my custom ones?

And thanks so much for helping me today!

Offline VapeTech

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: Badges not displaying
« Reply #17 on: July 25, 2015, 03:53:15 pm »
Oh, I know I can set the styles in the function for the IMG but it is using the thumbnail so if I try to make it  80x80px it is blurry.  I was just wondering how we can use the larger uploaded version.  I guess it would have to be a different image ??   $modSettings['badgeawards_url']  ..  I mean actually the array that hold the $bigimageFilename.  I can't see where you identify the thumb verses the big size.
« Last Edit: July 25, 2015, 04:05:40 pm by VapeTech »

Offline VapeTech

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: Badges not displaying
« Reply #18 on: July 25, 2015, 06:14:25 pm »
Found it :)    I change the SQL query to return the  large_Image and updated the array...  not bad for first time playing around with php...  I'm an ASP guy  :P

So I updated the function to return

echo '<img style="width:50px; height:50px" src="' . $modSettings['badgeawards_url']  . $row['Large_image'] . '" alt="' . $row['title'] . '" title="' . $row['title'] . '" /> ' . ' ' . $row['title'] ;

I did 50px because it fit the best

Just in case anyone else needs it.

Thanks a TON for your time today..  hopefully we can figure out the Image issue with the Ad Seller pro now

Jason

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15147
    • View Profile
Re: Badges not displaying
« Reply #19 on: July 25, 2015, 08:40:29 pm »
Nice good work glad you have it working.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
16 Replies
9452 Views
Last post November 12, 2007, 09:02:29 pm
by Rafferty
4 Replies
2736 Views
Last post March 15, 2010, 08:38:12 am
by mandomercs
7 Replies
3069 Views
Last post August 31, 2014, 09:40:44 pm
by SMFHacks
1 Replies
1930 Views
Last post February 12, 2015, 09:55:14 pm
by SMFHacks
3 Replies
2124 Views
Last post July 06, 2017, 05:02:31 pm
by SMFHacks

+- Recent Topics

Quality of images after import by SMFHacks
September 05, 2020, 10:21:44 am

How do I download gallery images? by CWVRV
August 30, 2020, 11:50:07 pm

Deleting Empty Galleries by SMFHacks
August 30, 2020, 11:43:32 am

PHP error by davejo
August 25, 2020, 07:35:13 am

Permissions to list ads and buy items by CWVRV
August 21, 2020, 05:19:45 pm

Doubt with download permissions. by Rock Lee
August 20, 2020, 08:23:24 pm

Attachment images Upsidedown or Sideways by SMFHacks
August 18, 2020, 05:41:07 pm

[Mod]Avatars Display Integration by Hatshepsut
August 17, 2020, 11:39:54 pm

Simple Portal Block - Classifieds by SMFHacks
August 16, 2020, 09:56:48 am

SMF Links by SMFHacks
August 16, 2020, 08:03:42 am

Powered by EzPortal