News:

Wondering if this will always be free?  See why free is better.

Main Menu

Need help integrate profile areas

Started by Rumpa, November 14, 2022, 10:20:52 PM

Previous topic - Next topic

Rumpa

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 You cannot view this attachment.

Steve

So, you want someone to write the code you need for one of your mods, correct?
DO NOT pm me for support!

Rumpa

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

TwitchisMental

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.

Rumpa

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

m4z

#5
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
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

Rumpa

Ok then anyone wants to rewrite the code for me please.


Illori

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.

Rumpa

^ok then thrash or lock the thread please

this thread has no meaning for now.

Advertisement: