Advertisement:

Author Topic: Adding a script in the footer  (Read 3425 times)

Offline PLAYBOY

  • SMF Hero
  • ******
  • Posts: 2,065
  • Livephotoshop.com & Lullabyabc.com
    • Lullabies and Us
Re: Adding a script in the footer
« Reply #20 on: October 10, 2018, 03:01:19 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:

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

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,127
  • Gender: Male
    • i30 Owners Club
Re: Adding a script in the footer
« Reply #21 on: October 10, 2018, 03:55:03 PM »
Well, you could always try a conditional:

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

Offline PLAYBOY

  • SMF Hero
  • ******
  • Posts: 2,065
  • Livephotoshop.com & Lullabyabc.com
    • Lullabies and Us
Re: Adding a script in the footer
« Reply #22 on: October 10, 2018, 04:02:44 PM »
Well, you could always try a conditional:

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

That worked out well. Thank you very much dude

Offline PLAYBOY

  • SMF Hero
  • ******
  • Posts: 2,065
  • Livephotoshop.com & Lullabyabc.com
    • Lullabies and Us
Re: Adding a script in the footer
« Reply #23 on: October 10, 2018, 04:03:40 PM »
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 :)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 70,994
    • StoryBB/StoryBB on GitHub
Re: Adding a script in the footer
« Reply #24 on: October 10, 2018, 04:45:30 PM »
This isn’t a small feature.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline PLAYBOY

  • SMF Hero
  • ******
  • Posts: 2,065
  • Livephotoshop.com & Lullabyabc.com
    • Lullabies and Us
Re: Adding a script in the footer
« Reply #25 on: October 10, 2018, 04:49:44 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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 70,994
    • StoryBB/StoryBB on GitHub
Re: Adding a script in the footer
« Reply #26 on: October 10, 2018, 04:55:38 PM »
My bad, I’m sure you’re right about that. Hope someone can help you.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,127
  • Gender: Male
    • i30 Owners Club
Re: Adding a script in the footer
« Reply #27 on: October 10, 2018, 05:04:57 PM »
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:

Code: [Select]
$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);


Offline PLAYBOY

  • SMF Hero
  • ******
  • Posts: 2,065
  • Livephotoshop.com & Lullabyabc.com
    • Lullabies and Us
Re: Adding a script in the footer
« Reply #28 on: October 10, 2018, 06:28:20 PM »
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