+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 186
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 187
Total: 187

Forum > Support

Badges not displaying

(1/4) > >>

VapeTech:
I have a general question first, is there a help file that shows all of the Action Labels or "Action" or are all of these hard coded already? 

This may be the problem again with the Reseller theme, but non of the badges are showing up http://www.vapeshopforum.com/index.php?topic=5.0  These are the list of badges http://www.vapeshopforum.com/index.php?action=badgeawards;sa=badges;u=1 I have selected in settings to show in posts, show total baged in posts and 10 number of badges all checked

Lastly, like a previous poster, I would like to manually award site sponsors with a larger badge (Perhaps 4 different ones)

Bronze Site Sponsor (For a yearly donation)
Silver Site Sponsor
Gold Site Sponsor
Platinum Site Sponsor

What can I do to get this done?

Thanks







VapeTech:
I think I fixed the badges not displaying.  I copied code from the default theme in the display template into my theme.  The custom Badges where I could post the code for the badge next to the Avatar would be great.

SMFHacks:
To create a custom badge that you manually award to someone you can do it the following way:
Admin -> Badge Awards -> Badge List
Then click "Add Badge"
Enter the badge information


Once the badge is made you can use
Admin -> Badge Awards -> Give Badge
To award a badge to a user




--- Quote ---I have a general question first, is there a help file that shows all of the Action Labels or "Action" or are all of these hard coded already? 

--- End quote ---
Each badge must have their own unique action/id  the action itself doesn't mean anything but is used in the code to check to auto award the badge on certain condition.
You can make one  up for any of the new custom badges you create.

List of actions used already. Do not reuse these. It should not allow it anyway
action
"anniversary1"
"anniversary10"
"anniversary2"
"anniversary3"
"anniversary4"
"anniversary5"
"anniversary6"
"anniversary7"
"anniversary8"
"anniversary9"
"arcadechampion"
"arcadehighscore"
"arcademaster"
"avatar"
"badgeaction1"
"bigbadge"
"combination"
"gallery"
"group"
"invisible"
"karma"
"karmabad"
"karmagood"
"level1"
"level10"
"level11"
"level12"
"level13"
"level14"
"level15"
"level2"
"level3"
"level4"
"level5"
"level6"
"level7"
"level8"
"level9"
"mobile"
"neversleep"
"oldbrowser"
"osapple"
"oslinux"
"oswindows"
"photographer"
"poll"
"poll10"
"poll100"
"poll25"
"poll50"
"pollvote"
"pollvote10"
"pollvote100"
"pollvote50"
"posts1"
"posts10"
"posts100"
"posts1000"
"posts10000"
"posts100000"
"posts15000"
"posts20000"
"posts2500"
"posts50"
"posts500"
"posts5000"
"posts50000"
"quickposter"
"search"
"signature"
"spammer100"
"spammer25"
"spammer250"
"spammer50"
"spammer500"
"supercombination"
"topic"
"webmaster"

VapeTech:
Thanks, I will try that, but is there a way to have these 3-4 larger badges to be placed separately (Like under the Avatar) something that stands out.  I am just trying to find a way to distinguish members that are site sponsors.  I bought the Badge pack to do that, but I kinda like what it does to promote interaction of the forum so I am thinking of another way that I can label these people as sponsors in some way that is outside of membership groups because I want their number of posts to be shown too.

Thanks a LOT for the help on a SATURDAY!

SMFHacks:
This code function would do it. Do you want when viewing a post?




--- Code: ---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();
if (($badgesCache = cache_get_data('badge_display_' . $memberID, 60)) == null)
{

$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 ($badgesList)
ORDER BY l.id_log DESC
LIMIT  $maxToShow
");
while ($row = $smcFunc['db_fetch_assoc']($result))
{
$badgesCache[] = $row;

}

cache_put_data('badge_display_' . $memberID, $badgesCache, 60);

}

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

}


}


--- End code ---

Then example code

--- Code: ---// The first column is the member id, second is order, third is number to show, the 4th column is what badge id's to only show
Badges_DisplayCustomBadges(###MEMBERIDHERE####, 'recent', 5, array(1,2,3,4,5));

--- End code ---

Navigation

[0] Message Index

[#] Next page

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 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

Powered by EzPortal
Go to full version