Forums / Cotonti / Extensions / Custom Header Message on POST

Hodges
#1 2013-11-05 15:02

Hello,

In a plugin I'm modifying, after the user submits a form the following code is executed:

		header("Location: message.php?msg=300");

outputting one of cotonti's built-in messages. How can I deliver a custom message using the same mechanism?

Hodges

Gökhan YILDIZ
#2 2013-11-05 15:59

open your plugin and

add

$msg = cot_import('msg', 'G', 'INT');
if ($msg == 'customID'){ header("Location: message.php?msg=customID"); }

open your /lang/en/message.en.lang.php

find:

$L['msg951_body'] = 'Your session is no longer valid. Please try again.';

add after:

//Custom Message
$L['msgCUSTOMID_title'] = 'custom message title';
$L['msgCUSTOMID_body'] = 'custom message details';

 

Gökhan YILDIZ
Hodges
#3 2013-11-06 15:18

Thanks for the reply. It works, but I was hoping for something that wouldn't require a core hack.

Gökhan YILDIZ
#4 2013-11-06 16:07

messages appear on the page itself a special. so you need to edit or need to run your plugin header So create your own plugin with a language file and add these codes into.

Gökhan YILDIZ