Advertisement:

Author Topic: Accessing certain variable in mini profile area  (Read 972 times)

Offline nofapturkiye

  • Semi-Newbie
  • *
  • Posts: 44
Accessing certain variable in mini profile area
« 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.





Code: [Select]
// 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
   






 

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 60,218
  • Gender: Male
    • Kindred-999 on GitHub
Re: Accessing certain variable in mini profile area
« Reply #1 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...
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."

Offline nofapturkiye

  • Semi-Newbie
  • *
  • Posts: 44
Re: Accessing certain variable in mini profile area
« Reply #2 on: July 08, 2017, 02:37:48 PM »
Here is my variable  Kindrey



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

   
Code: [Select]
$message['member']['counter'],   
We are already using it for posts as 
Quote
$message['member']['posts']


 and both values are declared in smf_members



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

« Last Edit: July 08, 2017, 02:59:20 PM by nofapturkiye »