News:

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

Main Menu

Adding a script in the footer

Started by PLAYBOY, October 08, 2018, 06:21:46 PM

Previous topic - Next topic

PLAYBOY

Quote from: Sh@mbles on October 10, 2018, 02:55:26 PM
You can't just bang it in willy nilly. You've probably inserted your edit within the context of an echo string.

Without seeing your code I'd guess you need to have done this:

';
include 'blockadblock.txt';
echo '




Awesome! Could you please make it so only guests will see it? I don`t want members or admins to see this

Shambles

Well, you could always try a conditional:

';
if ($context['user']['is_guest'])
    include 'blockadblock.txt';
echo '

PLAYBOY

Quote from: Sh@mbles on October 10, 2018, 03:55:03 PM
Well, you could always try a conditional:

';
if ($context['user']['is_guest'])
    include 'blockadblock.txt';
echo '


That worked out well. Thank you very much dude

PLAYBOY

Can I ask for a small favor?
Would you look at this issue also? I feel like you could help me on this with a single line of code

https://www.simplemachines.org/community/index.php?topic=562584.0

Please don`t get mad at me :)

Arantor


PLAYBOY

Quote from: Arantor on October 10, 2018, 04:45:30 PM
This isn't a small feature.

I may be wrong but I feel like whatever is the "send a notification email because of approval" code that is in the admin panel just needs to be copy & pasted to profile page as well so it will be triggered upon a click on approve.

Again I`m not a coder so this may not be the right approach. I just hope it was easy enough for someone to help

Arantor

My bad, I'm sure you're right about that. Hope someone can help you.

Shambles

No, the man is right - it isn't a small feature.

A quick check of the code shows that you could possibly utilise the "integrate_activate" hook (called within Profile-Actions.php->activateAccount) and devise a module to handle the member name passed thereto. Within that you'd need to interrogate the DB and fulfil other items as demonstrated in ManageMembers.php:

$replacements = array(
'NAME' => $member['name'],
'USERNAME' => $member['username'],
'PROFILELINK' => $scripturl . '?action=profile;u=' . $member['id'],
'FORGOTPASSWORDLINK' => $scripturl . '?action=reminder',
);

$emaildata = loadEmailTemplate('admin_approve_accept', $replacements, $member['language']);
sendmail($member['email'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);



PLAYBOY

Someone actually did it...
I haven`t tried it yet and I`ll be few hours before I can test it but it seems like it was pretty easy. Do you guys think he did it wrong?

https://www.simplemachines.org/community/index.php?topic=562584.msg3991597#msg3991597

Advertisement: