Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

New shortcut in warning template

Aloittaja ZachMTA, heinäkuu 28, 2013, 04:58:37 AP

« edellinen - seuraava »

ZachMTA

Okay I need some help creating a shortcut.



It's the same as {MESSAGE} but instead of instead of it showing the link I want it to show a quote, but make it stay there so is there anyway to actually implement or do that since I have no experience.

So something like {QUOTE} since the majority of the time the post gets deleted once the person has been warned I would be so thankful if someone could help.


emanuele

mmm...interesting idea.

* emanuele wonders if it is worth to include it in SMF...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Chalky


ZachMTA

It's already included in SMF, it's when you create a template for a warning issued to PM.



I'm just wondering if anyone knows how to make the exact same as {message} but instead {quote} as it would be so helpful.

Chalky

You've got me now.  I can't find anywhere in SMF to edit the template, which is why I assumed you were using a template editing mod  :-\

Illori

moderation center -> warnings -> custom templates -> add template

Chalky

Wow I never knew that was there!  Shows how well behaved all my members are  :D. Thanks Illori, I'll get my coat now... 

Illori

you dont need to go... now you just need to be our specialist on that feature ;)

ZachMTA

So, does anyone know how to make a new short? Or where the template would be?

emanuele

Warning: not tested, it may be badly broken.

Profile-Actions.php

Koodi (find) [Valitse]
SELECT subject
Koodi (replace with) [Valitse]
SELECT subject, body

Koodi (find) [Valitse]
list ($context['warned_message_subject']) = $smcFunc['db_fetch_row']($request);
Koodi (replace with) [Valitse]
list ($context['warned_message_subject'], $context['warned_message_body']) = $smcFunc['db_fetch_row']($request);

Koodi (find) [Valitse]
$context['warned_message_subject'] = '';
Koodi (replace with) [Valitse]
$context['warned_message_subject'] = '';
$context['warned_message_body'] = '';


Koodi (find) [Valitse]
if (!$context['warning_for_message'] && strpos($row['body'], '{MESSAGE}') !== false)
Koodi (replace with) [Valitse]
if (!$context['warning_for_message'] && (strpos($row['body'], '{MESSAGE}') !== false || strpos($row['body'], '{QUOTE}') !== false))

Koodi (find) [Valitse]
$context['notification_templates'][$k]['body'] = strtr($name['body'], array('{MEMBER}' => un_htmlspecialchars($context['member']['name']), '{MESSAGE}' => '[url=http://' . $scripturl . '?msg=' . $context['warning_for_message'] . ']' . un_htmlspecialchars($context['warned_message_subject']) . '[/url]', '{SCRIPTURL}' => $scripturl, '{FORUMNAME}' => $mbname, '{REGARDS}' => $txt['regards_team']));
Koodi (replace with) [Valitse]
$context['notification_templates'][$k]['body'] = strtr($name['body'], array('{MEMBER}' => un_htmlspecialchars($context['member']['name']), '{MESSAGE}' => '[url=http://' . $scripturl . '?msg=' . $context['warning_for_message'] . ']' . un_htmlspecialchars($context['warned_message_subject']) . '[/url]', '{quote}' => trim(un_htmlspecialchars(strip_tags(strtr(parse_bbc('[quote]' . $context['warned_message_body'] . '[/quote]', false, $context['warning_for_message']), array('<br />' => "\n", '</div>' => "\n", '</li>' => "\n", '[' => '[', ']' => ']'))))), '{SCRIPTURL}' => $scripturl, '{FORUMNAME}' => $mbname, '{REGARDS}' => $txt['regards_team']));


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

ZachMTA

It doesn't appear to work, has anyone else tried it?

emanuele

If maybe you can say what's the error you get... ;)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

ZachMTA

I get no error, it's just that nothing comes up and it doesn't work, perhaps I've done something wrong?

emanuele

So you created a new template using {QUOTE} in the text and it is not replaced?


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

ZachMTA

Lainaus käyttäjältä: emanuele - elokuu 01, 2013, 10:24:24 AP
So you created a new template using {QUOTE} in the text and it is not replaced?

Yes I get no error, but it just doesn't work

Advertisement: