Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Rumpa on November 14, 2022, 10:20:52 PM

Title: Need help integrate profile areas
Post by: Rumpa on November 14, 2022, 10:20:52 PM
Hello
I need help regarding integrate profile areas

I have a code which I want to reflect into profile.template.php via hook but it's not called where I can do mistake someone please solve this. Code is in the attachment RAIProfile.php
Title: Re: Need help integrate profile areas
Post by: Steve on November 15, 2022, 09:01:46 AM
So, you want someone to write the code you need for one of your mods, correct?
Title: Re: Need help integrate profile areas
Post by: Rumpa on November 15, 2022, 09:08:51 AM
Quote from: Steve on November 15, 2022, 09:01:46 AMSo, you want someone to write the code you need for one of your mods, correct?
not really mean that but help me to find out the wrong code.

real word is help me to write the code
Title: Re: Need help integrate profile areas
Post by: TwitchisMental on November 15, 2022, 11:37:27 AM
Quote from: Rumpa on November 15, 2022, 09:08:51 AM
Quote from: Steve on November 15, 2022, 09:01:46 AMSo, you want someone to write the code you need for one of your mods, correct?
not really mean that but help me to find out the wrong code.

real word is help me to write the code
I believe Shambles linked you to a website that would help you determine where the issue is within the code.

https://www.piliapp.com/php-syntax-check/

Another thing that could help is using an IDE. Eclipse and Atom are good solutions.
Title: Re: Need help integrate profile areas
Post by: Rumpa on November 15, 2022, 01:52:17 PM
Ok I checked that site with my below code
<?php

// If we are outside SMF throw an error.


if (!defined('SMF'))

die (
'Hacking attemt...');


function
template_summary(&$profile_areas)
{
global
$txt, $context;

loadlanguage('RecentActivityInProfile');

// Display member's recent activity
$profile_views['info']['views'] =
array(
if (isset(
$context['member']['action']) && allowedTo('who_view')) {
       echo
'<dt>', $txt['recent_activity'], ': </dt>
       <dd>'
, $context['member']['action'], '</dd>';
   }
}

?>

The site showing syntax error in
this line
if (isset($context['member']['action']) && allowedTo('who_view')) {
but when I edit core template file it's okay but with hook I got problem

Help me to these issue
Title: Re: Need help integrate profile areas
Post by: m4z on November 15, 2022, 03:40:58 PM
I'm not a php pro, but there's at least a closing parenthesis missing for the surrounding "array(".

Edit: also, that site says "syntax error, unexpected 'if'" which probably means you can't just put an if construct into an array.

Edit 2: Your problem seems similar to this: https://stackoverflow.com/questions/8329897/if-statement-within-an-array-declaration-is-that-possible
Title: Re: Need help integrate profile areas
Post by: Rumpa on November 16, 2022, 01:46:07 AM
Ok then anyone wants to rewrite the code for me please.

Title: Re: Need help integrate profile areas
Post by: Illori on November 16, 2022, 04:57:04 AM
Quote from: Rumpa on November 16, 2022, 01:46:07 AMOk then anyone wants to rewrite the code for me please.



why should we rewrite it for you? we dont have a use for it. we are not supporting it. if it is going in a mod you are making you should create the code so you understand how to support it. we cannot and will not write all the code you need for your mods.
Title: Re: Need help integrate profile areas
Post by: Rumpa on November 16, 2022, 05:31:24 AM
^ok then thrash or lock the thread please

this thread has no meaning for now.