Fork me on GitHub






Modification notification MP Manager
Régulier
Inscrit: 05/06/2009 00:15
Messages: 198
J'utilise MP Manager de TDM.

Un module super, sauf que j'aimerai que dans les options de notification la notification de nouveau message soit coché par default.

Merci pour votre aide.

Voici le code PHP de :optionbox.php

/* Include the header */
include_once("header.php");
/* Global Xoops User variable */
global $xoopsUser;
/* If $xoopsUser vriable is define then user is connected */
if (empty($xoopsUser)) {
redirect_header("".XOOPS_URL."/user.php",1,_PM_REGISTERNOW);
} else {
if (isset($_REQUEST['op'])) {
$op = $_REQUEST['op'];
} else {
$op = 'box';
}
$catbox = empty($_REQUEST['catbox'])?1:intval($_REQUEST['catbox']);
//alert
$pm_handler = & xoops_gethandler('priv_msgs');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
$total = $pm_handler->getCount($criteria);
unset($criteria);
$precistotal = number_format(($total*100)/$xoopsModuleConfig['maxuser'], 0, ",", " ");

//alert stockage
if ( $total > $xoopsModuleConfig['maxuser']) {
$msg_alert = _MP_ALERT."<br />"._MP_AVERT;
$mpstop = "stop";
}


switch($op) {
//Boite de reception
case "box":
default:

$xoopsOption['template_main'] = 'mp_optionbox.html';
include XOOPS_ROOT_PATH."/header.php";
//cherche les options utilisateur
$pm_handler = & xoops_gethandler('priv_msgsopt');
$opt = $pm_handler->get($xoopsUser->getVar('uid'));
if(!$opt) {
$limite = "10";
$home = "1";
$notif = "0";
$resend = "0";
$formtype = "4";
$sortname = _MP_TRI_DATE;
$sortorder = _MP_TRI_ODESC;
$order = _MP_TRI_FLAT;
} else {
$limite = $opt->getVar('limite');
$home = $opt->getVar('home');
$notif = $opt->getVar('notif');
$resend = $opt->getVar('resend');
$sortname = $opt->getVar('sortname');
$sortorder = $opt->getVar('sortorder');
$vieworder = $opt->getVar('vieworder');
$formtype = $opt->getVar('formtype');
}
//creation du formulaire d'ajout
$form = new XoopsThemeForm(_MP_DESC_OPT, "read", $_SERVER['PHP_SELF']);
$form_limit = new XoopsFormText(_MP_LIMIT, "limite", 2, 2, $limite);
$form->addElement($form_limit);
if ($xoopsModuleConfig['notification'] == "1") {
$form_notif = new XoopsFormCheckBox(_MP_NOTIF, 'notif', $notif);
$form_notif->addOption(1, '&nbsp;');
$form->addElement($form_notif);
}
$form_resend = new XoopsFormCheckBox(_MP_RESEND, 'resend', $resend);
$form_resend->addOption(1, '&nbsp;');
$form->addElement($form_resend);
$form_home = new XoopsFormCheckBox(_MP_OPT_HOME, 'home', $home);
$form_home->addOption(1, '&nbsp;');
$form->addElement($form_home);


$options = array();
$promotray = new XoopsFormElementTray('');
$option_select = new XoopsFormSelect(_MP_FORMTYPE, 'formtype', $formtype);
// $option_wins = array(
// '1' => 'Compact' , '2' => 'DHTML','3' => 'htmlarea', '4' => 'Koivi', '5' => 'TinyEditor', '6' => 'Inbetween' , '7' => 'spaw', '8' => 'FCK');

$option_wins = mp_selecteditor();
foreach($xoopsModuleConfig['wysiwyg'] as $option){
if(!empty($option_wins[$option]))
$options[$option]=$option_wins[$option];
}

$option_select->addOptionArray($options);
$form->addElement($option_select);


$form->insertBreak(_MP_TRI_TRI, 'odd');
$order_select = array('subject' => _MP_TRI_TITLE ,'msg_time' => _MP_TRI_DATE, 'read_msg' => _MP_TRI_READ);
$thread_select = new XoopsFormSelect ("", "sortname", $sortname);
$thread_select->addOptionArray($order_select);
$sortorder_select = array('asc' => _MP_TRI_OASC,'desc' => _MP_TRI_ODESC);
$sort_select = new XoopsFormSelect ("", "sortorder", $sortorder);
$sort_select->addOptionArray($sortorder_select);
$flat_select = array('flat' => _MP_TRI_FLAT,'thread' => _MP_TRI_THREAD);
$threadn_select = new XoopsFormSelect ("", "order", $vieworder);
$threadn_select->addOptionArray($flat_select);

$form->addElement($thread_select);
$form->addElement($threadn_select);
$form->addElement($sort_select);

$msg_hidden = new XoopsFormHidden("op", "envoimp");
$form->addElement($msg_hidden);
$button_tray = new XoopsFormElementTray('' ,'');
$post_button = new XoopsFormButton('', 'post_messages', _MP_SUBMIT, "submit");
$post_button -> setExtra("onclick='document.prvmsg.action=\"optionbox.php?op=envoimp\"'");
$button_tray->addElement($post_button);
$button_tray->addElement(new XoopsFormButton('', 'reset', _MP_CANCEL, 'reset'));
$form->addElement($button_tray);
$quick_reply = $form->render();
$xoopsTpl->assign('quick_reply', $quick_reply);
//$xoopsTpl->assign('mp_input_reply', "<input type='submit' onclick='document.prvmsg.action=\"optionbox.php?op=envoimp\"' id='lire' value='"._MP_SUBMIT."'>");
//$xoopsTpl->assign('mp_input_del', "<input type='reset' id='reply' value='"._MP_CANCEL."'>");
if( ( $view_perms & GPERM_MESS ) ) {
if (empty($mpstop)) {
$box_actions[] = '<select name="add" class="xo-message-form" OnChange="window.document.location=this.options[this.selectedIndex].value;"><option selected>'._MP_MNEWS.'</option><option value="'.XOOPS_URL.'/modules/'.$mydirname.'/msgbox.php?op=sendbox&send=1">-> '._MP_MMES.'</option><option value="'.XOOPS_URL.'/modules/'.$mydirname.'/contbox.php?op=sendbox">-> '._MP_MCONT.'</option><option value="'.XOOPS_URL.'/modules/'.$mydirname.'/filebox.php?op=sendbox">-> '._MP_MFILE.'</option></select>';
$box_actions[] = "<input type='submit' class='xo-message-form' onclick='document.prvmsg.action=\"optionbox.php?op=envoimp\"' id='lire' value='"._MP_SUBMIT."'>";
} else {
$box_actions[] = '<select name="add" class="xo-message-form" OnChange="window.document.location=this.options[this.selectedIndex].value;" disabled><option selected>'._MP_MNEWS.'</option><option value="'.XOOPS_URL.'/modules/'.$mydirname.'/msgbox.php?op=sendbox&send=1">-> '._MP_MMES.'</option><option value="'.XOOPS_URL.'/modules/'.$mydirname.'/contbox.php?op=sendbox">-> '._MP_MCONT.'</option><option value="'.XOOPS_URL.'/modules/'.$mydirname.'/filebox.php?op=sendbox">-> '._MP_MFILE.'</option></select>';
$box_actions[] = "<input type='submit' onclick='document.prvmsg.action=\"optionbox.php?op=envoimp\"' id='stop' value='"._MP_SUBMIT."'>";
}
}
$box_actions[] = "<input type='submit' class='xo-message-form' id='reset' value='"._MP_CANCEL."'>";
$box_actions[] = "<input type='hidden' name='catbox' value='".$catbox."'>";
$xoopsTpl->assign('box_actions', $box_actions);
break;
case "envoimp":
global $xoopsDB, $xoopsUser, $xoopsConfig;
$notif = !empty($_REQUEST['notif']) ? 1 : 0;
$resend = !empty($_REQUEST['resend']) ? 1 : 0;
$limite = !empty($_REQUEST['limite']) ? $_REQUEST['limite'] : 10;
$home = !empty($_REQUEST['home']) ? $_REQUEST['home'] : 0;
$sortorder = !empty($_REQUEST['sortorder']) ? $_REQUEST['sortorder'] : 'desc';
$sortname = !empty($_REQUEST['sortname']) ? $_REQUEST['sortname'] : 'msg_time';
$order = !empty($_REQUEST['order']) ? $_REQUEST['order'] : 'flat';
$formtype = !empty($_REQUEST['formtype']) ? $_REQUEST['formtype'] : '4';
if (empty($xoopsUser)) {
redirect_header("".XOOPS_URL."/user.php",1,_PM_REGISTERNOW);
} else {
$pm_handler = & xoops_gethandler('priv_msgsopt');
$pm =& $pm_handler->create();
$pm->setVar("userid", $xoopsUser->getVar('uid'));
$pm->setVar("notif", $notif);
$pm->setVar("resend", $resend);
$pm->setVar("limite", $limite);
$pm->setVar("home", $home);
$pm->setVar("sortname", $sortname);
$pm->setVar("sortorder", $sortorder);
$pm->setVar("vieworder", $order);
$pm->setVar("formtype", $formtype);
$pm_arr =& $pm_handler->get($xoopsUser->getVar('uid'));
if ($pm_arr) {
$erreur = $pm_handler->update($pm);
} else {
$erreur = $pm_handler->insert($pm);
}
if (!$erreur) {
redirect_header("javascript:history.go(-1)",2, _PM_REDNON);
} else {
redirect_header("optionbox.php?op=box",2, _MP_REDIF_NOTIF);
}
}
break;
}


//Affiche les Dossiers
mp_category($precistotal, $catbox, @$catpid);
//Language & menu
$xoopsTpl->assign('lang_private', _PM_PRIVATEMESSAGE);
$xoopsTpl->assign('lang_rece', _PM_RECE);
$xoopsTpl->assign('lang_mes', _MP_MESSAGE);
$xoopsTpl->assign('lang_news', _MP_NEWS);
$xoopsTpl->assign('lang_file', _MP_FILE);
$xoopsTpl->assign('lang_menu', MpMenu('optionbox.php'));
$xoopsTpl->assign('mp_precistotal', sprintf(_MP_MDEBIT, $precistotal.'%'));
// $xoopsTpl->assign('lang_msg', sprintf(_MP_MSG, $cattitle));
$xoopsTpl->assign('mp_catbox', $catbox);
// $xoopsTpl->assign('xoops_module_header', $mp_module_header);
mp_cache();
include XOOPS_ROOT_PATH."/footer.php";

}
?>

Posté le : 30/09/2009 10:13
Partager Twitter Partagez cette article sur GG+
Re: Modification notification MP Manager
Semi pro
Inscrit: 26/03/2004 17:57
De Metz
Messages: 1210
Facile modifie ligne 70

$notif "0";


Par

$notif "1";


Cordialement, Venom

Posté le : 30/09/2009 11:14
Partager Twitter Partagez cette article sur GG+
Re: Modification notification MP Manager
Régulier
Inscrit: 05/06/2009 00:15
Messages: 198
OK merci Venom,

Je suis un super Newbie, alors j'apprend.

Julio.

Posté le : 30/09/2009 11:37
Partager Twitter Partagez cette article sur GG+
Re: Modification notification MP Manager
Régulier
Inscrit: 05/06/2009 00:15
Messages: 198
Juste une petite chose,

Je profite de ton savoir.

aurait tu une idée pour modifier les couleurs de mon thème. "phoenix".

Mon site

Je n'aime pas les couleurs rose clair et fonce des lignes.

Exemple : "block Nouveaux membres"

Merci d'avance.

Julio.

Posté le : 30/09/2009 11:54
Partager Twitter Partagez cette article sur GG+
Re: Modification notification MP Manager
Xoops accro
Inscrit: 20/02/2008 20:27
De Belgium
Messages: 2708
Les couleurs sont definies avec les selecteurs odd et even dans des fichiers CSS, comme /themes/multi/css/content.css et /themes/multi/css/style.css

Posté le : 30/09/2009 12:04

Salutations, Gerard.
PS: Excusez mon mauvais français.
De la bonne manière de poser les questions
Partager Twitter Partagez cette article sur GG+
Re: Modification notification MP Manager
Régulier
Inscrit: 04/02/2003 03:43
De Carcassonne
Messages: 173
Salut Julio,

comme le dit Ghia change la couleur de ton background-color des classes even et odd, normalement tu as juste à modifier cela dans ton fichier multi/css/content.css

ps: pense à créer un nouveau post dans le forum approprié lorsque tu as d'autres questions qui sont différentes de ton post initial; au lieu de poster à la suite. Cela sera plus simple

Posté le : 30/09/2009 12:33

vivement l'heure de l'apéro
Partager Twitter Partagez cette article sur GG+
Re: Modification notification MP Manager
Régulier
Inscrit: 05/06/2009 00:15
Messages: 198
Merci pour votre réponse.

Je penserai à créer un nouveau post promis.

Posté le : 30/09/2009 17:27
Partager Twitter Partagez cette article sur GG+
Re: Modification notification MP Manager
Semi pro
Inscrit: 04/08/2005 14:16
De Quelque part dans les étoiles...
Messages: 1141
Alors si tout est corrige, on cloture le sujet

Posté le : 01/10/2009 14:21

Il n'y a qu'une chose que vous pouvez changer dans l'Univers : c'est Vous-Même !
Partager Twitter Partagez cette article sur GG+

 Haut   Précédent   Suivant



Vous pouvez voir les sujets.
Vous ne pouvez pas débuter de nouveaux sujets.
Vous ne pouvez pas répondre aux contributions.
Vous ne pouvez pas éditer vos contributions.
Vous ne pouvez pas effacez vos contributions.
Vous ne pouvez pas ajouter de nouveaux sondages.
Vous ne pouvez pas voter en sondage.
Vous ne pouvez pas attacher des fichiers à vos contributions.
Vous ne pouvez pas poster sans approbation.

Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

96 Personne(s) en ligne (84 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 96 | Plus ...