Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43260
Total Topics: 7518
Most Online Today: 297
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 281
Total: 282

Author Topic: Badges not displaying  (Read 10140 times)

0 Members and 1 Guest are viewing this topic.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • 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

  • Member
  • *
  • 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

  • Member
  • *
  • 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

  • Member
  • *
  • 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: 16436
    • 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
10983 Views
Last post November 12, 2007, 09:02:29 pm
by Rafferty
4 Replies
4161 Views
Last post March 15, 2010, 08:38:12 am
by mandomercs
7 Replies
4376 Views
Last post August 31, 2014, 09:40:44 pm
by SMFHacks
1 Replies
3283 Views
Last post February 12, 2015, 09:55:14 pm
by SMFHacks
3 Replies
4014 Views
Last post July 06, 2017, 05:02:31 pm
by SMFHacks

+- Recent Topics

No thumbnails on new uploads by Tonyvic
Today at 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal