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: 256
Total: 257

Author Topic: Code for ultimate Profile  (Read 14357 times)

0 Members and 1 Guest are viewing this topic.

Offline Draffi

  • Menu Editor Pro Customer
  • Jr. Member
  • *****
  • Posts: 76
    • View Profile
Code for ultimate Profile
« on: May 21, 2013, 02:06:10 pm »
I was trying to add a code-snippet to the "Ultimate-Profile"-Page, using this on:
Code: [Select]
$modSettings['badgeawards_url'] = $boardurl . '/badges/';
  $memberID = $context['member']['id'];     
$badgesCache = array();
if (($badgesCache = cache_get_data('badge_display_' . $memberID, 60)) == null)
{

$result = db_query("
SELECT
b.id_badge, b.title, b.image, b.enabled, l.date
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
ORDER BY l.id_log DESC

", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($result))
{
$badgesCache[] = $row;

}

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

}

But this gave me an error:
" Call to undefined function db_query()"

Can somebody help me out?

(SMF 2.0.4)

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Code for ultimate Profile
« Reply #1 on: May 21, 2013, 02:22:59 pm »
Here is SMF 2.0 code for that part
Code: [Select]
global $boardurl,$smcFunc,$modSettings;
 
 $modSettings['badgeawards_url'] = $boardurl . '/badges/';
  $memberID = $context['member']['id'];     
$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, l.date
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
ORDER BY l.id_log DESC

");
while ($row = $smcFunc['db_fetch_assoc']($result))
{
$badgesCache[] = $row;

}

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

}
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 Draffi

  • Menu Editor Pro Customer
  • Jr. Member
  • *****
  • Posts: 76
    • View Profile
Re: Code for ultimate Profile
« Reply #2 on: May 21, 2013, 02:57:39 pm »
I`m sure, that code is right (no error), but i never see any badges...Or is this only for the new one i will get?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Code for ultimate Profile
« Reply #3 on: May 21, 2013, 03:21:13 pm »
Well it needs display code too that code above just pulls the badges.
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 Draffi

  • Menu Editor Pro Customer
  • Jr. Member
  • *****
  • Posts: 76
    • View Profile
Re: Code for ultimate Profile
« Reply #4 on: May 21, 2013, 03:27:16 pm »
Ah...okay. Thank you sir!

(Uiiiii, How can i do this:

Quote
Well it needs display code too that code above just pulls the badges.
)


Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Code for ultimate Profile
« Reply #5 on: May 24, 2013, 03:59:57 pm »
How do you want the appear? Horizontal/Vertical?
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 Draffi

  • Menu Editor Pro Customer
  • Jr. Member
  • *****
  • Posts: 76
    • View Profile
Re: Code for ultimate Profile
« Reply #6 on: May 24, 2013, 05:22:09 pm »
Horizontal with a table

(taken the mod settings from the Admin-menu -How many shown in post-display)

Offline 420connect

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: Code for ultimate Profile
« Reply #7 on: February 06, 2015, 11:44:33 am »
Sorry for bumping this..


I'm also looking to add the block shown below the posters information of their top X badges.

I've tried adding

Code: [Select]
// Badge Awards
global $sourcedir, $modSettings;
if (!empty($modSettings['badgeawards_enable']) && !empty($message['member']['id']))
{

require_once($sourcedir . '/badgeawards2.php');
if (!empty($modSettings['badgeawards_showtotalinposts']))
echo '<br />' . $txt['badge_txt_totalbadges'] .  Badges_TotalMemberCount($message['member']['id']);

if (!empty($modSettings['badgeawards_showinposts']))
{
echo '<br />' . $txt['badge_badges'] . ': <a href="' . $scripturl . '?action=badgeawards;sa=badges;u=' . $message['member']['id'] .'">' . $txt['badge_txt_viewall'] . '</a><br />';
Badges_DisplayBadges($message['member']['id'],'recent',$modSettings['badgeawards_numdisplay']);
}
}

// End Badge Awards

to UltimateProfile.template.php

and if I'm understanding this thread; added

Code: [Select]
[quote author=SMFHacks link=topic=7679.msg32982#msg32982 date=1369164179]
Here is SMF 2.0 code for that part
[code]
 global $boardurl,$smcFunc,$modSettings;
 
 $modSettings['badgeawards_url'] = $boardurl . '/badges/';
  $memberID = $context['member']['id'];     
$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, l.date
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
ORDER BY l.id_log DESC

");
while ($row = $smcFunc['db_fetch_assoc']($result))
{
$badgesCache[] = $row;

}

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

}
[/quote][/code]

near the top of the UltimateProfile.template.php

but still no sign of any badges appearing?  :o

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Code for ultimate Profile
« Reply #8 on: February 06, 2015, 11:48:29 am »
$message['member']['id'] in your example should change to $context['member']['id']
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 420connect

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: Code for ultimate Profile
« Reply #9 on: February 06, 2015, 11:54:19 am »
Love you!  :-*


Offline 420connect

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: Code for ultimate Profile
« Reply #10 on: February 06, 2015, 12:13:29 pm »
similarly,
 to add what I have shown below the message posters about the arcade "champion of.." etc.

could you help me add this to Ultimate Profile

I've added:

Code: [Select]
require_once($sourcedir.'/ArcadeSigsStats_v2.php');
at the top of UltimateProfile.template.php

and

Code: [Select]
arcade_champs_post_profile($message);
where I'd like it shown but no success.. :(

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16436
    • View Profile
Re: Code for ultimate Profile
« Reply #11 on: February 06, 2015, 12:18:12 pm »
Well $message is not part of the profile so that is why it is not 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/

Offline 420connect

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: Code for ultimate Profile
« Reply #12 on: February 06, 2015, 01:28:37 pm »
tried

Code: [Select]
arcade_champs_post_profile($message); with lots of different variations but still no luck in getting the actual pop up to work correctly.

I can just get it to show the arcade icon and can't see any code that I would add to input the "Champion of... (3 game icons)" part :(

php gives me headaches  :-[

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
3526 Views
Last post January 19, 2008, 08:32:54 am
by RWL
0 Replies
3617 Views
Last post February 10, 2009, 08:33:34 pm
by bluedevil
1 Replies
3543 Views
Last post August 09, 2011, 08:43:03 pm
by SMFHacks
1 Replies
6552 Views
Last post July 08, 2013, 10:56:10 pm
by SMFHacks
0 Replies
5030 Views
Last post December 02, 2013, 07:58:26 am
by electricwildflower

+- 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