News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Accessing certain variable in mini profile area

Started by nofapturkiye, July 08, 2017, 07:25:26 AM

Previous topic - Next topic

nofapturkiye

Hello everyone ; 

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





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






 

Kindred

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...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

nofapturkiye

#2
Here is my variable  Kindrey



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"; 



Advertisement: