Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: nofapturkiye on July 08, 2017, 07:25:26 AM

Title: Accessing certain variable in mini profile area
Post by: nofapturkiye on July 08, 2017, 07:25:26 AM
Hello everyone ; 

I am having a big problem about  understanding  how can i display  information in miniprofile.


(https://i.hizliresim.com/XXXXDk.png)


// Show how many posts they have made.

if (!isset($context['disabled_fields']['posts']))

echo '

<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';



// Show counter data. (just copy paste )

if (!isset($context['disabled_fields']['counter']))

echo '

<li class="countercount">', $txt['member_countercount'], ': ', $message['member']['counter'], '</li>';



I need to know where should i go and  edit neccesary variable like   $context['disabled_fields']['counter']

i have my data in   smf_members, counter . what should i do to use  ['member']['counter'] ?  something big is missing.

Please help me about this
   






 
Title: Re: Accessing certain variable in mini profile area
Post by: Kindred on July 08, 2017, 10:39:37 AM
Ummm....  what is the counter and how does it get populated?

Are you sure it is in the members database table?

You would have to edit more than just the template, since the databases information is pulled into the arrays in the sources files...  and context, in this case, is only filled with the board/forum options/settings and the current user data... not the poster's data... that's a very different variable array and is filled in different source files, depending on how, where, when, it is used...
Title: Re: Accessing certain variable in mini profile area
Post by: nofapturkiye on July 08, 2017, 02:37:48 PM
Here is my variable  Kindrey

(https://i.hizliresim.com/Lnn8YZ.png)

Quote from: Kindred on July 08, 2017, 10:39:37 AM
You would have to edit more than just the template, since the databases information is pulled into the arrays in the sources files...  and context, in this case, is only filled with the board/forum options/settings and the current user data... not the poster's data...


Could you simply guide me about neccessary steps please?


Edit:  I need to achive something like this...

    $message['member']['counter'],   

We are already using it for posts as 
Quote$message['member']['posts']


and both values are declared in smf_members




I can access that variable  in php block just like this:
$sql = "SELECT 'sayac' FROM `smf_members` WHERE`smf_members`.`id_member` =$id";