function fill($prefix, $listid) { global $server_name, $tables, $table_prefix; # check for not too many $domain = getConfig('domain'); $res = Sql_query("select count(*) from {$tables['user']}"); $row = Sql_fetch_row($res); if ($row[0] > 50000) { error('Hmm, I think 50 thousand users is quite enough for a test<br/>This machine does need to do other things you know.'); print '<script language="Javascript" type="text/javascript"> document.forms[0].output.value="Done. Now there are ' . $row[0] . ' users in the database";</script>' . "\n"; return 0; } # fill the database with "users" who have any combination of attribute values $attributes = array(); $res = Sql_query("select * from {$tables['attribute']} where type = \"select\" or type = \"checkbox\" or type=\"radio\""); $num_attributes = Sql_Affected_rows(); $total_attr = 0; $total_val = 0; while ($row = Sql_fetch_array($res)) { array_push($attributes, $row['id']); ++$total_attr; $values[$row['id']] = array(); $res2 = Sql_query("select * from {$table_prefix}" . 'listattr_' . $row['tablename']); while ($row2 = Sql_fetch_array($res2)) { array_push($values[$row['id']], $row2['id']); ++$total_val; } } $total = $total_attr * $total_val; if (!$total) { Fatal_Error('Can only do stress test when some attributes exist'); return 0; } for ($i = 0; $i < $total; ++$i) { $data = array(); reset($attributes); while (list($key, $val) = each($attributes)) { $data[$val] = current($values[$val]); if (!$data[$val]) { reset($values[$val]); $data[$val] = current($values[$val]); } next($values[$val]); } $query = sprintf('insert into %s (email,entered,confirmed) values("testuser%s",now(),1)', $tables['user'], $prefix . '-' . $i . '@' . $domain); $result = Sql_query($query, 0); $userid = Sql_insert_id(); if ($userid) { $result = Sql_query("replace into {$tables['listuser']} (userid,listid,entered) values({$userid},{$listid},now())"); reset($data); while (list($key, $val) = each($data)) { if ($key && $val) { Sql_query("replace into {$tables['user_attribute']} (attributeid,userid,value) values(" . $key . ",{$userid}," . $val . ')'); } } } } return 1; }
function Subcategories_getBySuperCat($super_category) { $sql = "SELECT * FROM sub_category WHERE super_cat = '" . $super_category . "'"; return Sql_query($sql); }
<p>На этой странице Вы можете подготовить письмо для дальнейшей отправки. Можно указать всю необходимую информацию, исключая списки рассылки для отправки. Затем, в момент отправки подготовленного письма, можно будет выбрать списки рассылки и письмо будет отправлено. </p> <p>Ваше подготовленное письмо постоянно, то есть оно не исчезнет после отправки и может быть использовано много раз повторно. Будьте осторожны, пользуясь этой возможностью, потому что это может привести к тому, что Вы будете отправлять одни и те же письма Вашим подписчикам несколько раз.</p> <p> Эта функциональность специально реализована с целью использовать при совместной работе в системе нескольких администраторов. Если главный администратор готовит такое письмо, простые администраторы могут отправлять его по своим спискам рассылки. В этом случае, Вы можете использовать дополнительные метки в письме: атрибуты администратора.</p> <p>Для примера, если у Вас есть атрибут администратора <b>Name</b> (Имя), Вы можете добавить метку [LISTOWNER.NAME], она будет заменена на <b>Имя</b> владельца списка, кому производится отправка этого письма. Значение будет установлено вне зависимости от того, кто отправляет письмо. Таким образом, если главный администратор отправляет письмо по списку, которые принадлежит кому-то ещё, метка [LISTOWNER] будет заменена на значение владельца списка, а не значения главного администратора.</p> <p>Для справки:<br/> Метка [LISTOWNER] задаётся в формате <b>[LISTOWNER.АТРИБУТ]</b></p> <p>На текущий момент заданы следующие атрибуты администратора: <table border=1><tr><td><b>Атрибут</b></td><td><b>Метка</b></td></tr> <?php $req = Sql_query("select name from {$tables['adminattribute']} order by listorder"); if (!Sql_Affected_Rows()) { print '<tr><td colspan=2>Атрибутов администратора нет</td></tr>'; } while ($row = Sql_Fetch_Row($req)) { if (strlen($row[0]) < 20) { printf('<tr><td>%s</td><td>[LISTOWNER.%s]</td></tr>', $row[0], strtoupper($row[0])); } } ?> </p>
function Users_getByID($id) { $sql = "SELECT * FROM users WHERE id = " . $id; return Sql_query($sql)[0]; }
if (sizeof($_POST) || $_GET["unblacklist"]) { print Error($GLOBALS['I18N']->get('you only have privileges to view this page, not change any of the information')); return; } break; case "none": default: $subselect = " and " . $tables["list"] . ".id = 0"; break; } if (isset($_GET["unblacklist"])) { $unblacklist = sprintf('%d', $_GET["unblacklist"]); unBlackList($unblacklist); Redirect("userhistory&id=" . $unblacklist); } $result = Sql_query("SELECT * FROM {$tables["user"]} where id = {$id}"); if (!Sql_Affected_Rows()) { Fatal_Error($GLOBALS['I18N']->get('no such User')); return; } $user = sql_fetch_array($result); print '<h3>' . $GLOBALS['I18N']->get('user') . ' ' . PageLink2("user&id=" . $user["id"], $user["email"]) . '</h3>'; print '<div class="actions">'; //printf('<a href="%s" class="button">%s</a>',getConfig("preferencesurl"). //'&uid='.$user["uniqid"],$GLOBALS['I18N']->get('update page')); //printf('<a href="%s" class="button">%s</a>',getConfig("unsubscribeurl").'&uid='.$user["uniqid"],$GLOBALS['I18N']->get('unsubscribe page')); print PageLinkButton("user&id={$id}", $GLOBALS['I18N']->get('Details')); if ($access != "view") { printf("<a class=\"delete button\" href=\"javascript:deleteRec('%s');\">" . $GLOBALS['I18N']->get('delete') . "</a>", PageURL2("user", "", "delete={$id}")); } print '</div>';
$count_query = sprintf('select * from %s where id in (%s)', $GLOBALS['tables']['user'], join(', ', $userids)); if (!empty($_GET["calculate"])) { printf('.. ' . $GLOBALS['I18N']->get('%d users apply'), $num_users) . '</p>'; } if ($messageid) { Sql_query(sprintf('update %s set userselection = "%s" where id = %d', $tables["message"], addslashes($count_query), $messageid)); } if (!isset($_GET['calculate'])) { $ls->addButton($GLOBALS['I18N']->get("calculate"), $baseurl . '&tab=' . $_GET["tab"] . '&calculate=1'); } else { $ls->addButton($GLOBALS['I18N']->get("reload"), $baseurl . '&tab=' . $_GET["tab"]); } $existing_criteria = $ls->display(); } else { if ($messageid) { Sql_query(sprintf('update %s set userselection = "" where id = %d', $tables["message"], $messageid)); } } } // end of define STACKED_ATTRIBUTES ############################## # Stacked attributes, end ############################## // Pull in $footer variable from post if (isset($_POST["footer"])) { $footer = $_POST["footer"]; } // If $id wasn't passed in (if it was passed, then $_POST should have // the database value in it already, and if it's empty, then we should // leave it empty) and $footer is blank, load the default. if (!$footer) {
function Arbo_construire($code_arbo = '', $type = 'article') { /*=============*/ Lib_myLog("Recuperation de l'arbo a partir de la BDD"); if ($type == 'tache') { // On récupère tous les taches de la base $args_taches['id_tache'] = '*'; $liste_taches = Taches_chercher($args_taches); $tab_intitules = array(); foreach ($liste_taches as $tache) { $tab_intitules[$tache['id_tache']] = $tache['titre']; $tab_etats[$tache['id_tache']] = $tache['etat']; $tab_priorites[$tache['id_tache']] = $tache['data1']; } } if ($type == 'article') { // On récupère tous les articles de la base $args_articles['id_article'] = '*'; $liste_articles = Articles_chercher($args_articles); $tab_intitules = array(); $tab_urls = array(); foreach ($liste_articles as $article) { $tab_intitules[$article['id_article']] = $article['titre']; $tab_etats[$article['id_article']] = $article['etat']; $tab_urls[$article['id_article']] = $article['meta_url']; } } $sql = " SELECT * \n\t\t\tFROM " . $GLOBALS['prefix'] . "arbo\n\t\t\tWHERE code_arbo = '{$code_arbo}'\n\t\t\tORDER BY famille ASC, ordre ASC"; $result = Sql_query($sql); $tab_sql = array(); if ($result && Sql_errorCode($result) === "00000") { while ($row = Sql_fetch($result)) { $id = $row['id_arbo']; $id_pere = $row['id_pere']; $type_pere = $row['type_pere']; $tab_sql[$id]["id_arbo"] = $id; $tab_sql[$id]["id_arbo_pere"] = $row['id_arbo_pere']; $tab_sql[$id]["code_arbo"] = $row['code_arbo']; $tab_sql[$id]["famille"] = $row['famille']; $tab_sql[$id]["id_pere"] = $id_pere; if ($type == 'tache') { $tab_sql[$id]["tache"] = $liste_taches[$id_pere]; } if ($type == 'article') { $tab_sql[$id]["article"] = $liste_articles[$id_pere]; } $tab_sql[$id]["type_pere"] = $type_pere; $tab_sql[$id]["ordre"] = $row['ordre']; $tab_sql[$id]["couleur"] = $row['couleur']; $tab_sql[$id]["etat"] = ($type_pere == 'article' || $type_pere == 'tache') && isset($tab_etats[$id_pere]) && $tab_etats[$id_pere] != '' ? $tab_etats[$id_pere] : $row['etat']; $tab_sql[$id]["intitule"] = ($type_pere == 'article' || $type_pere == 'tache') && isset($tab_intitules[$id_pere]) && $tab_intitules[$id_pere] != '' ? $tab_intitules[$id_pere] : Sql_prepareTexteAffichage($row['intitule']); $tab_sql[$id]["intitule_canonize"] = $row['intitule_canonize']; $tab_sql[$id]["priorite"] = $type_pere == 'tache' && isset($tab_priorites[$id_pere]) && $tab_priorites[$id_pere] != '' ? $tab_priorites[$id_pere] : ''; if ($type_pere == 'tache' && isset($tab_etats[$id_pere]) && $tab_etats[$id_pere] == 'inactif') { if ($row['famille'] != '' && $row['id_arbo_pere'] == 0) { $tab_famille = explode('-', $row['famille']); $index_pere = count($tab_famille) - 2; $tab_sql[$tab_famille[$index_pere]]['nb_taches_a_faire']++; if (!empty($tab_famille[$index_pere - 1])) { $tab_sql[$tab_famille[$index_pere - 1]]['nb_taches_a_faire']++; } } else { $tab_sql[$id]['nb_taches_a_faire'] = 0; } } if ($type_pere == 'tache' && isset($tab_etats[$id_pere]) && $tab_etats[$id_pere] == 'actif') { if ($row['famille'] != '' && $row['id_arbo_pere'] == 0) { $tab_famille = explode('-', $row['famille']); $index_pere = count($tab_famille) - 2; $tab_sql[$tab_famille[$index_pere]]['nb_taches_terminees']++; if (!empty($tab_famille[$index_pere - 1])) { $tab_sql[$tab_famille[$index_pere - 1]]['nb_taches_terminees']++; } } else { $tab_sql[$id]['nb_taches_terminees'] = 0; } } // On détermine le niveau de profondeur dans l'arborescence $tab_sql[$id]["niveau"] = substr_count($row['famille'], "-"); } } /*=============*/ Lib_myLog("Tab sql:", $tab_sql); /*=============*/ Lib_myLog("Construction de l'arbo"); $tab_result = Arbo_getTab($tab_sql, 0, ''); return $tab_result; }
function deleteBounce($id = 0) { if (!$id) { return; } $id = sprintf('%d', $id); Sql_query(sprintf('delete from %s where id = %d', $GLOBALS['tables']['bounce'], $id)); Sql_query(sprintf('delete from %s where bounce = %d', $GLOBALS['tables']['user_message_bounce'], $id)); Sql_query(sprintf('delete from %s where bounce = %d', $GLOBALS['tables']['bounceregex_bounce'], $id)); }
?> ' FCKConfig.SmileyImages = [<?php echo $smileys; ?> ] ; FCKConfig.SmileyColumns = 8 ; FCKConfig.SmileyWindowWidth = 320 ; FCKConfig.SmileyWindowHeight = 240 ; <?php exit; } elseif ($_GET['action'] == 'js4') { ob_end_clean(); header('Content-type: text/plain'); $req = Sql_query(sprintf('select name from %s where type in ("textline","select") order by listorder', $GLOBALS['tables']['attribute'])); $attnames = ';preferences url;unsubscribe url'; $attcodes = ';[PREFERENCES];[UNSUBSCRIBE]'; while ($row = Sql_Fetch_Row($req)) { $attnames .= ';' . strtolower(substr($row[0], 0, 15)); $attcodes .= ';[' . strtoupper($row[0]) . ']'; } $imgdir = $_SERVER['DOCUMENT_ROOT'] . $GLOBALS['pageroot'] . '/' . FCKIMAGES_DIR . '/'; $enable_image_upload = is_dir($imgdir) && is_writable($imgdir) ? 'true' : 'false'; if (defined('UPLOADIMAGES_DIR')) { $imgdir = $_SERVER['DOCUMENT_ROOT'] . '/' . UPLOADIMAGES_DIR . '/'; $enable_image_upload = is_dir($imgdir) && is_writable($imgdir) ? 'true' : 'false'; } $smileypath = $_SERVER['DOCUMENT_ROOT'] . $GLOBALS['pageroot'] . '/images/smiley'; $smileyextensions = array('gif'); $smileys = '';
In het bericht veld kan u "variabelen" gebruiken, die zullen worden vervangen met de overeenkomstige info voor een gebruiker: <br />De variabelen moeten van de vorm <b>[NAAM]</b> zijn, waar NAAM kan worden vervangen met de naam van een van je attributen. <br />Bijvoorbeeld als u een attribuut "Voornaam" heeft, plaats [VOORNAAM] ergens in het bericht om aan te duiden waar de "Voornaam" waarde van de ontvangers moet worden ingevoegd. </p><p>Momenteel heeft u de volgende attributen ingesteld: <table border=1><tr><td><b>Attribuut</b></td><td><b>Placeholder</b></td></tr> <?php $req = Sql_query("select name from {$tables["attribute"]} order by listorder"); while ($row = Sql_Fetch_Row($req)) { if (strlen($row[0]) < 20) { printf('<tr><td>%s</td><td>[%s]</td></tr>', $row[0], strtoupper($row[0])); } } print '</table>'; if (ENABLE_RSS) { ?> <p>U kan een templates aanmaken voor berichten die worden verzonden met RSS items. Om dit te doen, klik op de "Tijdsschema" tab en duid de frequentie voor het bericht aan. Het bericht zal dan worden gebruikt om de lijst met items naar gebruikers op de lijst te verzenden, die deze frequentie hebben ingesteld. U moet het veld (of placeholder) [RSS] in je bericht gebruiken om aan te duiden waar de lijst moet komen.</p> <?php } ?> <p>Om de inhoud van een webpagina te verzenden, voeg de volgende toe aan de inhoud van je bericht:<br/> <b>[URL:</b>http://www.voorbeeld.be/pad/naar/bestand.html<b>]</b></p> <p>U kan eenvoudige gebruikers info toevoegen aan deze URL, geen attribuut informatie:</br> <b>[URL:</b>http://www.voorbeeld.org/gebruikersprofiel.php?email=<b>[</b>email<b>]]</b><br/> </p>
function ListAvailableLists($userid = 0,$lists_to_show = "") { global $tables; $list = $_POST["list"]; $subselect = "";$listset = array(); $showlists = explode(",",$lists_to_show); foreach ($showlists as $listid) if (preg_match("/^\d+$/",$listid)) array_push($listset,$listid); if (sizeof($listset) >= 1) { $subselect = "where id in (".join(",",$listset).") "; } $some = 0; $html = '<ul class="list">'; $result = Sql_query("SELECT * FROM {$tables["list"]} $subselect order by listorder"); while ($row = Sql_fetch_array($result)) { if ($row["active"]) { $html .= '<li class="list"><input type="checkbox" name="list['.$row["id"] . ']" value=signup '; if ($list[$row["id"]] == "signup") $html .= "checked"; if ($userid) { $req = Sql_Fetch_Row_Query(sprintf('select userid from %s where userid = %d and listid = %d', $tables["listuser"],$userid,$row["id"])); if (Sql_Affected_Rows()) $html .= "checked"; } $html .= "/><b>".$row["name"].'</b><div class="listdescription">'; $desc = nl2br(StripSlashes($row["description"])); $html .= '<input type=hidden name="listname['.$row["id"] . ']" value="'.$row["name"].'"/>'; $html .= $desc.'</div></li>'; $some++; if ($some == 1) { $singlelisthtml = sprintf('<input type="hidden" name="list[%d]" value="signup">',$row["id"]); $singlelisthtml .= '<input type="hidden" name="listname['.$row["id"] . ']" value="'.$row["name"].'"/>'; } } } $html .= '</ul>'; $hidesinglelist = getConfig("hide_single_list"); if (!$some) { global $strNotAvailable; return '<p>'.$strNotAvailable.'</p>'; } elseif ($some == 1 && $hidesinglelist == "true") { return $singlelisthtml; } else { global $strPleaseSelect; return '<p>'.$strPleaseSelect .':</p>'.$html; } }
$timeleft = ($num_users - $sent) * $secpermsg; $eta = date('D j M H:i', time() + $timeleft); setMessageData($messageid, 'ETA', $eta); setMessageData($messageid, 'msg/hr', $msgperhour); setMessageData($messageid, 'to process', $num_users - $sent); } $processed = $notsent + $sent + $invalid + $unconfirmed + $cannotsend + $failed_sent; output($GLOBALS['I18N']->get('Processed') . ' ' . $processed . ' ' . $GLOBALS['I18N']->get('out of') . ' ' . $num_users . ' ' . $GLOBALS['I18N']->get('users')); if ($num_users - $sent <= 0) { # this message is done if (!$someusers) { output($GLOBALS['I18N']->get('Hmmm, No users found to send to')); } if (!$failed_sent) { repeatMessage($messageid); $status = Sql_query(sprintf('update %s set status = "sent",sent = now() where id = %d', $GLOBALS['tables']['message'], $messageid)); if (!empty($msgdata['notify_end']) && !isset($msgdata['end_notified'])) { $notifications = explode(',', $msgdata['notify_end']); foreach ($notifications as $notification) { sendMail($notification, $GLOBALS['I18N']->get('Message Sending has finished'), sprintf($GLOBALS['I18N']->get('phplist has finished sending the message with subject %s'), $message['subject'])); } Sql_Query(sprintf('insert ignore into %s (name,id,data) values("end_notified",%d,now())', $GLOBALS['tables']['messagedata'], $messageid)); } $timetaken = Sql_Fetch_Row_query("select sent,sendstart from {$tables['message']} where id = \"{$messageid}\""); output($GLOBALS['I18N']->get('It took') . ' ' . timeDiff($timetaken[0], $timetaken[1]) . ' ' . $GLOBALS['I18N']->get('to send this message')); sendMessageStats($messageid); } } else { if ($script_stage < 5) { $script_stage = 5; }
/** Retourne un tableau de saveurs correspondant aux champs du tableau en argument. @param $args */ function Saveurs_chercher($args) { $count = 0; $tab_result = array(); if (isset($args['count'])) { $sql = " SELECT count(*) nb_enregistrements \n\t\t\t\t\tFROM " . $GLOBALS['prefix'] . "saveur\n\t\t\t\t\tWHERE 1"; } else { $sql = " SELECT * \n\t\t\t\t\tFROM " . $GLOBALS['prefix'] . "saveur\n\t\t\t\t\tWHERE 1"; } if (!isset($args['id_saveur']) && !isset($args['pourcent_eth0_dans_arome_pur_1']) && !isset($args['pourcent_eth0_dans_arome_pur_2']) && !isset($args['pourcent_eth0_dans_arome_pur_3']) && !isset($args['pourcent_eth0_dans_arome_pur_4']) && !isset($args['pourcent_eth0_dans_arome_pur_5']) && !isset($args['pourcent_eth0_dans_arome_pur_6']) && !isset($args['pourcent_arome_pur_dans_arome_prod_1']) && !isset($args['pourcent_arome_pur_dans_arome_prod_2']) && !isset($args['pourcent_arome_pur_dans_arome_prod_3']) && !isset($args['pourcent_arome_pur_dans_arome_prod_4']) && !isset($args['pourcent_arome_pur_dans_arome_prod_5']) && !isset($args['pourcent_arome_pur_dans_arome_prod_6']) && !isset($args['pourcent_alcool_prod_dans_arome_prod']) && !isset($args['pourcent_eau_dans_arome_prod']) && !isset($args['pourcent_arome_prod_dans_e_liquide_1']) && !isset($args['pourcent_arome_prod_dans_e_liquide_2']) && !isset($args['pourcent_arome_prod_dans_e_liquide_3']) && !isset($args['etat']) && !isset($args['order_by']) && !isset($args['etat']) && !isset($args['tab_ids_saveurs'])) { return $tab_result; } $condition = ""; if (isset($args['id_saveur']) && $args['id_saveur'] != "*") { $condition .= " AND id_saveur = '" . $args['id_saveur'] . "' "; } if (isset($args['pourcent_eth0_dans_arome_pur_1']) && $args['pourcent_eth0_dans_arome_pur_1'] != "*") { $condition .= " AND pourcent_eth0_dans_arome_pur_1 = '" . strtr($this->pourcent_eth0_dans_arome_pur_1, ",", ".") . "' "; } if (isset($args['pourcent_eth0_dans_arome_pur_2']) && $args['pourcent_eth0_dans_arome_pur_2'] != "*") { $condition .= " AND pourcent_eth0_dans_arome_pur_2 = '" . strtr($this->pourcent_eth0_dans_arome_pur_2, ",", ".") . "' "; } if (isset($args['pourcent_eth0_dans_arome_pur_3']) && $args['pourcent_eth0_dans_arome_pur_3'] != "*") { $condition .= " AND pourcent_eth0_dans_arome_pur_3 = '" . strtr($this->pourcent_eth0_dans_arome_pur_3, ",", ".") . "' "; } if (isset($args['pourcent_eth0_dans_arome_pur_4']) && $args['pourcent_eth0_dans_arome_pur_4'] != "*") { $condition .= " AND pourcent_eth0_dans_arome_pur_4 = '" . strtr($this->pourcent_eth0_dans_arome_pur_4, ",", ".") . "' "; } if (isset($args['pourcent_eth0_dans_arome_pur_5']) && $args['pourcent_eth0_dans_arome_pur_5'] != "*") { $condition .= " AND pourcent_eth0_dans_arome_pur_5 = '" . strtr($this->pourcent_eth0_dans_arome_pur_5, ",", ".") . "' "; } if (isset($args['pourcent_eth0_dans_arome_pur_6']) && $args['pourcent_eth0_dans_arome_pur_6'] != "*") { $condition .= " AND pourcent_eth0_dans_arome_pur_6 = '" . strtr($this->pourcent_eth0_dans_arome_pur_6, ",", ".") . "' "; } if (isset($args['pourcent_arome_pur_dans_arome_prod_1']) && $args['pourcent_arome_pur_dans_arome_prod_1'] != "*") { $condition .= " AND pourcent_arome_pur_dans_arome_prod_1 = '" . strtr($this->pourcent_arome_pur_dans_arome_prod_1, ",", ".") . "' "; } if (isset($args['pourcent_arome_pur_dans_arome_prod_2']) && $args['pourcent_arome_pur_dans_arome_prod_2'] != "*") { $condition .= " AND pourcent_arome_pur_dans_arome_prod_2 = '" . strtr($this->pourcent_arome_pur_dans_arome_prod_2, ",", ".") . "' "; } if (isset($args['pourcent_arome_pur_dans_arome_prod_3']) && $args['pourcent_arome_pur_dans_arome_prod_3'] != "*") { $condition .= " AND pourcent_arome_pur_dans_arome_prod_3 = '" . strtr($this->pourcent_arome_pur_dans_arome_prod_3, ",", ".") . "' "; } if (isset($args['pourcent_arome_pur_dans_arome_prod_4']) && $args['pourcent_arome_pur_dans_arome_prod_4'] != "*") { $condition .= " AND pourcent_arome_pur_dans_arome_prod_4 = '" . strtr($this->pourcent_arome_pur_dans_arome_prod_4, ",", ".") . "' "; } if (isset($args['pourcent_arome_pur_dans_arome_prod_5']) && $args['pourcent_arome_pur_dans_arome_prod_5'] != "*") { $condition .= " AND pourcent_arome_pur_dans_arome_prod_5 = '" . strtr($this->pourcent_arome_pur_dans_arome_prod_5, ",", ".") . "' "; } if (isset($args['pourcent_arome_pur_dans_arome_prod_6']) && $args['pourcent_arome_pur_dans_arome_prod_6'] != "*") { $condition .= " AND pourcent_arome_pur_dans_arome_prod_6 = '" . strtr($this->pourcent_arome_pur_dans_arome_prod_6, ",", ".") . "' "; } if (isset($args['pourcent_alcool_prod_dans_arome_prod']) && $args['pourcent_alcool_prod_dans_arome_prod'] != "*") { $condition .= " AND pourcent_alcool_prod_dans_arome_prod = '" . strtr($this->pourcent_alcool_prod_dans_arome_prod, ",", ".") . "' "; } if (isset($args['pourcent_eau_dans_arome_prod']) && $args['pourcent_eau_dans_arome_prod'] != "*") { $condition .= " AND pourcent_eau_dans_arome_prod = '" . strtr($this->pourcent_eau_dans_arome_prod, ",", ".") . "' "; } if (isset($args['pourcent_arome_prod_dans_e_liquide_1']) && $args['pourcent_arome_prod_dans_e_liquide_1'] != "*") { $condition .= " AND pourcent_arome_prod_dans_e_liquide_1 = '" . strtr($this->pourcent_arome_prod_dans_e_liquide_1, ",", ".") . "' "; } if (isset($args['pourcent_arome_prod_dans_e_liquide_2']) && $args['pourcent_arome_prod_dans_e_liquide_2'] != "*") { $condition .= " AND pourcent_arome_prod_dans_e_liquide_2 = '" . strtr($this->pourcent_arome_prod_dans_e_liquide_2, ",", ".") . "' "; } if (isset($args['pourcent_arome_prod_dans_e_liquide_3']) && $args['pourcent_arome_prod_dans_e_liquide_3'] != "*") { $condition .= " AND pourcent_arome_prod_dans_e_liquide_3 = '" . strtr($this->pourcent_arome_prod_dans_e_liquide_3, ",", ".") . "' "; } if (isset($args['etat']) && $args['etat'] != "*") { $condition .= " AND etat = '" . $args['etat'] . "' "; } if (isset($args['tab_ids_saveurs']) && $args['tab_ids_saveurs'] != "*") { $ids = implode(",", $args['tab_ids_saveurs']); $condition .= " AND id_saveur IN (0" . $ids . ") "; } if (!isset($args['etat'])) { $condition .= " AND etat != 'supprime' "; } $sql .= $condition; if (isset($args['order_by']) && !isset($args['asc_desc'])) { $sql .= " ORDER BY " . $args['order_by'] . " ASC"; } if (isset($args['order_by']) && isset($args['asc_desc'])) { $sql .= " ORDER BY " . $args['order_by'] . " " . $args['asc_desc']; } if (isset($args['limit']) && !isset($args['start'])) { $sql .= " LIMIT " . $args['limit']; } if (isset($args['limit']) && isset($args['start'])) { $sql .= " LIMIT " . $args['start'] . "," . $args['limit']; } /*=============*/ Lib_myLog("SQL: {$sql}"); $result = Sql_query($sql); if (isset($args['count'])) { if ($result && Sql_errorCode($result) === "00000") { $row = Sql_fetch($result); $count = $row['nb_enregistrements']; } return $count; } else { if ($result && Sql_errorCode($result) === "00000") { while ($row = Sql_fetch($result)) { $id = $row['id_saveur']; $tab_result[$id]["id_saveur"] = $id; $tab_result[$id]["pourcent_eth0_dans_arome_pur_1"] = $row['pourcent_eth0_dans_arome_pur_1']; $tab_result[$id]["pourcent_eth0_dans_arome_pur_2"] = $row['pourcent_eth0_dans_arome_pur_2']; $tab_result[$id]["pourcent_eth0_dans_arome_pur_3"] = $row['pourcent_eth0_dans_arome_pur_3']; $tab_result[$id]["pourcent_eth0_dans_arome_pur_4"] = $row['pourcent_eth0_dans_arome_pur_4']; $tab_result[$id]["pourcent_eth0_dans_arome_pur_5"] = $row['pourcent_eth0_dans_arome_pur_5']; $tab_result[$id]["pourcent_eth0_dans_arome_pur_6"] = $row['pourcent_eth0_dans_arome_pur_6']; $tab_result[$id]["pourcent_arome_pur_dans_arome_prod_1"] = $row['pourcent_arome_pur_dans_arome_prod_1']; $tab_result[$id]["pourcent_arome_pur_dans_arome_prod_2"] = $row['pourcent_arome_pur_dans_arome_prod_2']; $tab_result[$id]["pourcent_arome_pur_dans_arome_prod_3"] = $row['pourcent_arome_pur_dans_arome_prod_3']; $tab_result[$id]["pourcent_arome_pur_dans_arome_prod_4"] = $row['pourcent_arome_pur_dans_arome_prod_4']; $tab_result[$id]["pourcent_arome_pur_dans_arome_prod_5"] = $row['pourcent_arome_pur_dans_arome_prod_5']; $tab_result[$id]["pourcent_arome_pur_dans_arome_prod_6"] = $row['pourcent_arome_pur_dans_arome_prod_6']; $tab_result[$id]["pourcent_alcool_prod_dans_arome_prod"] = $row['pourcent_alcool_prod_dans_arome_prod']; $tab_result[$id]["pourcent_eau_dans_arome_prod"] = $row['pourcent_eau_dans_arome_prod']; $tab_result[$id]["pourcent_arome_prod_dans_e_liquide_1"] = $row['pourcent_arome_prod_dans_e_liquide_1']; $tab_result[$id]["pourcent_arome_prod_dans_e_liquide_2"] = $row['pourcent_arome_prod_dans_e_liquide_2']; $tab_result[$id]["pourcent_arome_prod_dans_e_liquide_3"] = $row['pourcent_arome_prod_dans_e_liquide_3']; $tab_result[$id]["etat"] = $row['etat']; $tab_result[$id]["date_add"] = $row['date_add']; $tab_result[$id]["date_upd"] = $row['date_upd']; $tab_result[$id]["info_saveur"] = Sql_prepareTexteAffichage($row['info_saveur']); } } if (count($tab_result) == 1 && ($args['id_saveur'] != '' && $args['id_saveur'] != '*')) { $tab_result = array_pop($tab_result); } } return $tab_result; }
function addUniqID($userid) { Sql_query(sprintf('update %s set uniqid = "%s" where id = %d', $GLOBALS['tables']['user'], getUniqID(), $userid)); }
Sql_query(sprintf('insert into %s (name) values("%s")', $valuestable, $firstdata['name'])); $val = Sql_Insert_Id(); Sql_query(sprintf('update %s set value="%s" where attributeid = %d', $tables['user_attribute'], $val, $first)); Sql_query(sprintf('update %s set type="checkboxgroup" where id = %d', $tables['attribute'], $first)); $cbg_initiated = 1; } switch ($firstdata['type']) { case 'textline': case 'hidden': case 'textarea': case 'date': Sql_query(sprintf('delete from %s where attributeid = %d and value = ""', $tables['user_attribute'], $first)); # we can just keep the data and mark it as the first attribute Sql_query(sprintf('update ignore %s set attributeid = %d where attributeid = %d', $tables['user_attribute'], $first, $attid), 1); # delete the ones that didn't copy across, because there was a value already Sql_query(sprintf('delete from %s where id = %d', $tables['attribute'], $attid)); # mark forms to use the merged attribute if ($formtable_exists) { Sql_Query(sprintf('update formfield set attribute = %d where attribute = %d', $first, $attid), 1); } break; case 'radio': case 'select': # merge user values Sql_Query(sprintf('delete from %s where attributeid = %d and value = ""', $tables['user_attribute'], $first)); $req = Sql_Query(sprintf('select * from %s', $table_prefix . 'listattr_' . $attdata['tablename'])); while ($val = Sql_Fetch_Array($req)) { # check if it already exists $exists = Sql_Fetch_row_Query(sprintf('select id from %s where name = "%s"', $valuestable, $val['name'])); if (!$exists[0]) { Sql_Query(sprintf('insert into %s (name) values("%s")', $valuestable, $val['name']));
$limit = $_SESSION['messagenumpp']; $offset = 0; if (isset($start) && $start > 0) { $offset = $start; } else { $start = 0; } $paging = ''; if ($total > $_SESSION['messagenumpp']) { $paging = simplePaging("messages{$url_keep}", $start, $total, $_SESSION['messagenumpp'], $GLOBALS['I18N']->get('Campaigns')); } $ls = new WebblerListing(s('Campaigns')); $ls->usePanel($paging); ## messages table if ($total) { $result = Sql_query('SELECT * FROM ' . $tables['message'] . " {$whereClause} {$sortBySql} limit {$limit} offset {$offset}"); while ($msg = Sql_fetch_array($result)) { $editlink = ''; $messagedata = loadMessageData($msg['id']); if ($messagedata['subject'] != $messagedata['campaigntitle']) { $listingelement = '<!--' . $msg['id'] . '-->' . stripslashes($messagedata['campaigntitle']) . '<br/><strong>' . stripslashes($messagedata['subject']) . '</strong>'; } else { $listingelement = '<!--' . $msg['id'] . '-->' . stripslashes($messagedata['subject']); } # $listingelement = '<!--'.$msg['id'].'-->'.stripslashes($messagedata["campaigntitle"]); if ($msg['status'] == 'draft') { $editlink = PageUrl2('send&id=' . $msg['id']); } $ls->addElement($listingelement, $editlink); $ls->setClass($listingelement, 'row1'); $uniqueviews = Sql_Fetch_Row_Query("select count(userid) from {$tables['usermessage']} where viewed is not null and status = 'sent' and messageid = " . $msg['id']);
} if ($_POST["overwrite"] == "yes") { if ($usetwo) { Sql_query(sprintf('replace into %s (attributeid,userid,value) values(%d,%d,"%s")', $tables["user_attribute"], $firstname_att_id, $userid, $importuser["firstname"])); Sql_query(sprintf('replace into %s (attributeid,userid,value) values(%d,%d,"%s")', $tables["user_attribute"], $lastname_att_id, $userid, $importuser["lastname"])); } else { Sql_query(sprintf('replace into %s (attributeid,userid,value) values(%d,%d,"%s")', $tables["user_attribute"], $name_att_id, $userid, $importuser["personal"])); } } #add this user to the lists identified reset($lists); $addition = 0; $listoflists = ""; while (list($key, $listid) = each($lists)) { $query = "replace INTO " . $tables["listuser"] . " (userid,listid,entered) values({$userid},{$listid},current_timestamp)"; $result = Sql_query($query); # if the affected rows is 2, the user was already subscribed $addition = $addition || Sql_Affected_Rows() == 1; $listoflists .= " * " . $available_lists[$listid] . "\n"; } if ($addition) { $additional_emails++; } if (!TEST && $_POST["notify"] == "yes" && $addition) { $subscribemessage = str_replace('[LISTS]', $listoflists, getUserConfig("subscribemessage", $userid)); sendMail($email, getConfig("subscribesubject"), $subscribemessage, system_messageheaders(), $envelope); } } // end if } // end foreach
} echo "... " . $GLOBALS['I18N']->get("ok") . "<br />\n"; } else { echo "... " . $GLOBALS['I18N']->get("failed") . "<br />\n"; } } } # if ($success) { # mark the database to be our current version Sql_Query(sprintf('replace into %s (item,value,editable) values("version","%s",0)', $tables["config"], VERSION)); # mark now to be the last time we checked for an update Sql_Query(sprintf('replace into %s (item,value,editable) values("updatelastcheck",now(),0)', $tables["config"])); # add a testlist $info = $GLOBALS['I18N']->get("List for testing."); $result = Sql_query("insert into {$tables["list"]} (name,description,entered,active,owner) values(\"test\",\"{$info}\",now(),0,1)"); $body = ' Version: ' . VERSION . "\r\n" . ' Url: ' . getConfig("website") . $pageroot . "\r\n"; printf('<p>' . $GLOBALS['I18N']->get('Success') . ': <a href="mailto:phplist2@tincan.co.uk?subject=Successful installation of phplist&body=%s">' . $GLOBALS['I18N']->get('Tell us about it') . '</a>. </p>', $body); printf('<p> ' . $GLOBALS['I18N']->get("Please make sure to read the file README.security that can be found in the zip file.") . '</p>'); printf('<p> ' . $GLOBALS['I18N']->get("Please make sure to") . ' <a href="http://tincan.co.uk/lists/?p=subscribe"> ' . $GLOBALS['I18N']->get("subscribe to the announcements list") . "</a> " . $GLOBALS['I18N']->get("to make sure you are updated when new versions come out. Sometimes security bugs are found which make it important to upgrade. Traffic on the list is very low.") . ' </p>'); print "<p>" . $GLOBALS['I18N']->get("Continue with") . " " . PageLink2("setup", $GLOBALS['I18N']->get("PHPlist Setup")) . "</p>"; } else { print '<ul><li>' . $GLOBALS['I18N']->get("Maybe you want to") . " " . PageLink2("upgrade", $GLOBALS['I18N']->get("Upgrade")) . ' ' . $GLOBALS['I18N']->get("instead?") . ' <li>' . PageLink2("initialise", $GLOBALS['I18N']->get("Force Initialisation"), "force=yes") . ' ' . $GLOBALS['I18N']->get("(will erase all data!)") . ' ' . "</ul>\n"; } /* if ($_GET["firstinstall"] || $_SESSION["firstinstall"]) {
$ls_del = sprintf('<a href="javascript:deleteRec(\'%s\');" class="del">del</a>', PageURL2("users&start={$start}&find={$find}&findby={$findby}&delete=" . $user['id'])); } /* if (isset ($user['foreignkey'])) { $ls->addColumn($user["email"], $GLOBALS['I18N']->get('key'), $user["foreignkey"]); } if (isset ($user["display"])) { $ls->addColumn($user["email"], " ", $user["display"]); } */ if (in_array('lists', $columns)) { $lists = Sql_query('SELECT count(*) FROM ' . $tables['listuser'] . ',' . $tables['list'] . ' where userid = ' . $user['id'] . ' and ' . $tables['listuser'] . '.listid = ' . $tables['list'] . '.id'); $membership = Sql_fetch_row($lists); $ls->addColumn($user['email'], $GLOBALS['I18N']->get('lists'), $membership[0]); } if (in_array('messages', $columns)) { $msgs = Sql_query('SELECT count(*) FROM ' . $tables['usermessage'] . ' where userid = ' . $user['id'] . ' and status = "sent"'); $nummsgs = Sql_fetch_row($msgs); $ls_msgs = $GLOBALS['I18N']->get('msgs') . ': ' . $nummsgs[0]; } ### allow plugins to add columns if (isset($GLOBALS['plugins']) && is_array($GLOBALS['plugins'])) { foreach ($GLOBALS['plugins'] as $plugin) { if (method_exists($plugin, 'displayUsers')) { $plugin->displayUsers($user, $user['email'], $ls); } } } $ls_bncs = ''; if (in_array('bounces', $columns) && !empty($user['bouncecount'])) { $ls_bncs = $GLOBALS['I18N']->get('bncs') . ': ' . $user['bouncecount']; }
$trackingcode = 'utm_source=phplist' . $messageid . '&utm_medium=email&utm_content=text&utm_campaign=' . urlencode($messagedata['subject']); } $viewed = Sql_Fetch_Row_query(sprintf('select viewed from %s where messageid = %d and userid = %d', $GLOBALS['tables']['usermessage'], $messageid, $userid)); if (!$viewed[0]) { Sql_Query(sprintf('update %s set viewed = now() where messageid = %d and userid = %d', $GLOBALS['tables']['usermessage'], $messageid, $userid)); Sql_Query(sprintf('update %s set viewed = viewed + 1 where id = %d', $GLOBALS['tables']['message'], $messageid)); } $uml = Sql_Fetch_Array_Query(sprintf('select * from %s where messageid = %d and forwardid = %d and userid = %d', $GLOBALS['tables']['linktrack_uml_click'], $messageid, $fwdid, $userid)); if (empty($uml['firstclick'])) { Sql_query(sprintf('insert into %s set firstclick = now(), forwardid = %d, messageid = %d, userid = %d', $GLOBALS['tables']['linktrack_uml_click'], $fwdid, $messageid, $userid)); } Sql_query(sprintf('update %s set clicked = clicked + 1, latestclick = now() where forwardid = %d and messageid = %d and userid = %d', $GLOBALS['tables']['linktrack_uml_click'], $fwdid, $messageid, $userid)); if ($msgtype == 'H') { Sql_query(sprintf('update %s set htmlclicked = htmlclicked + 1 where forwardid = %d and messageid = %d and userid = %d', $GLOBALS['tables']['linktrack_uml_click'], $fwdid, $messageid, $userid)); } elseif ($msgtype == 'T') { Sql_query(sprintf('update %s set textclicked = textclicked + 1 where forwardid = %d and messageid = %d and userid = %d', $GLOBALS['tables']['linktrack_uml_click'], $fwdid, $messageid, $userid)); } $url = $linkdata['url']; if ($linkdata['personalise']) { $uid = Sql_Fetch_Row_Query(sprintf('select uniqid from %s where id = %d', $GLOBALS['tables']['user'], $userid)); if ($uid[0]) { if (strpos($url, '?')) { $url .= '&uid=' . $uid[0]; } else { $url .= '?uid=' . $uid[0]; } } } #print "$url<br/>"; if (!isset($_SESSION['entrypoint'])) { $_SESSION['entrypoint'] = $url;
function deleteItem($table, $attributeid, $delete) { global $tables, $replace; # delete the index in delete $valreq = Sql_Fetch_Row_query("select name from {$table} where id = {$delete}"); $val = $valreq[0]; # check dependencies $dependencies = array(); $result = Sql_query("select distinct userid from {$tables['user_attribute']} where\n attributeid = {$attributeid} and value = {$delete}"); while ($row = Sql_fetch_array($result)) { array_push($dependencies, $row["userid"]); } if (sizeof($dependencies) == 0) { $result = Sql_query("delete from {$table} where id = {$delete}"); } else { if ($replace) { $result = Sql_Query("update {$tables['user_attribute']} set value = {$replace} where value = {$delete}"); $result = Sql_query("delete from {$table} where id = {$delete}"); } else { ?> Cannot delete <b><?php echo $val; ?> </b><br /> The Following record(s) are dependent on this value<br /> Update the record(s) to not use this attribute value and try again<p> <?php for ($i = 0; $i < sizeof($dependencies); $i++) { print PageLink2("user", "User " . $dependencies[$i], "id={$dependencies[$i]}") . "<br />\n"; if ($i > 10) { print "* Too many to list, total dependencies:\n " . sizeof($dependencies) . "<br /><br />"; giveAlternative($table, $delete, $attributeid); return 0; } } print "</p><br />"; giveAlternative($table, $delete, $attributeid); } } return 1; }
function listPlaceHolders() { $html = '<table border="1"><tr><td><strong>' . s('Attribute') . '</strong></td><td><strong>' . s('Placeholder') . '</strong></td></tr>'; $req = Sql_query('select name from ' . $GLOBALS['tables']['attribute'] . ' order by listorder'); while ($row = Sql_Fetch_Row($req)) { if (strlen($row[0]) <= 30) { $html .= sprintf('<tr><td>%s</td><td>[%s]</td></tr>', $row[0], strtoupper(cleanAttributeName($row[0]))); } } $html .= '</table>'; return $html; }
} Sql_Query("alter table {$tables["list"]} add column owner integer"); Sql_Query("alter table {$tables["message"]} change column status status enum('submitted','inprocess','sent','cancelled','prepared')"); Sql_Query("alter table {$tables["template"]} change column template template longblob"); # previous versions did not cleanup properly, fix that here $req = Sql_Query("select userid from {$tables["user_attribute"]} left join {$tables["user"]} on {$tables["user_attribute"]}.userid = {$tables["user"]}.id where {$tables["user"]}.id IS NULL"); while ($row = Sql_Fetch_Row($req)) { Sql_query("delete from " . $tables["user_attribute"] . " where userid = " . $row[0]); } $req = Sql_Query("select user from {$tables["user_message_bounce"]} left join {$tables["user"]} on {$tables["user_message_bounce"]}.user = {$tables["user"]}.id where {$tables["user"]}.id IS NULL"); while ($row = Sql_Fetch_Row($req)) { Sql_query("delete from " . $tables["user_message_bounce"] . " where user = "******"select userid from {$tables["usermessage"]} left join {$tables["user"]} on {$tables["usermessage"]}.userid = {$tables["user"]}.id where {$tables["user"]}.id IS NULL"); while ($row = Sql_Fetch_Row($req)) { Sql_query("delete from " . $tables["usermessage"] . " where userid = " . $row[0]); } $success = 1; case "1.5.0": # nothing changed # nothing changed case "1.5.1": # nothing changed # nothing changed case "1.6.0": case "1.6.1": # not released # nothing changed # not released # nothing changed case "1.6.2":
<?php } print '</td></tr>'; if (ENABLE_RSS) { print '<tr><td colspan=2><h1>' . $GLOBALS['I18N']->get('RSS settings') . '</h1></td></tr>'; printf('<tr><td valign=top>' . $GLOBALS['I18N']->get('Intro Text') . '</td><td> <textarea name=rssintro rows=3 cols=60>%s</textarea></td></tr>', htmlspecialchars(stripslashes($data["rssintro"]))); foreach ($rssfrequencies as $key => $val) { printf('<tr><td colspan=2><input type=checkbox name="rss[]" value="%s" %s> %s %s (%s <input type=radio name="rssdefault" value="%s" %s>) </td></tr>', $key, in_array($key, $rss) ? "checked" : "", $GLOBALS['I18N']->get('Offer option to receive'), $GLOBALS['I18N']->get($val), $GLOBALS['I18N']->get('default'), $key, $data["rssdefault"] == $key ? "checked" : ""); } print "<tr><td colspan=2><hr></td></tr>"; } print '<tr><td colspan=2><h1>' . $GLOBALS['I18N']->get('Select the lists to offer') . '</h1></td></tr>'; $req = Sql_query("SELECT * FROM {$tables["list"]} {$subselect} order by listorder"); if (!Sql_Affected_Rows()) { print '<tr><td colspan=2>' . $GLOBALS['I18N']->get('No lists available, please create one first') . '</td></tr>'; } while ($row = Sql_Fetch_Array($req)) { printf('<tr><td valign=top width=150><input type=checkbox name="list[%d]" value="%d" %s> %s</td><td>%s</td></tr>', $row["id"], $row["id"], in_array($row["id"], $selected_lists) ? "checked" : "", stripslashes($row["name"]), stripslashes($row["description"])); } print '</table>'; if ($GLOBALS["require_login"] && (isSuperUser() || accessLevel("spageedit") == "all")) { print '<br/>' . $GLOBALS['I18N']->get('Owner') . ': <select name="owner">'; $admins = $GLOBALS["admin_auth"]->listAdmins(); foreach ($admins as $adminid => $adminname) { printf('<option value="%d" %s>%s</option>', $adminid, $adminid == $data['owner'] ? 'selected' : '', $adminname); } print '</select>'; }
foreach ($GLOBALS['plugins'] as $plname => $plugin) { $plugin->processError('Send test capped from ' . count($emailaddresses) . ' to ' . SENDTEST_MAX); } $limited = array_chunk($emailaddresses, SENDTEST_MAX); $emailaddresses = $limited[0]; $sendtestresult .= s('There is a maximum of %d test emails allowed', SENDTEST_MAX) . '<br/>'; } } # var_dump($emailaddresses);#exit; $messagedata['testtarget'] = ''; foreach ($emailaddresses as $address) { $address = trim($address); if (empty($address)) { continue; } $result = Sql_query(sprintf('select id,email,uniqid,htmlemail,rssfrequency,confirmed from %s where email = "%s"', $tables['user'], sql_escape($address))); //Leftover from the preplugin era if ($user = Sql_fetch_array($result)) { if (FORWARD_ALTERNATIVE_CONTENT && $_GET['tab'] == 'Forward') { if (SEND_ONE_TESTMAIL) { $success = sendEmail($id, $address, $user['uniqid'], $user['htmlemail'], array(), array($address)); } else { $success = sendEmail($id, $address, $user['uniqid'], 1, array(), array($address)) && sendEmail($id, $address, $user['uniqid'], 0, array(), array($address)); } } else { if (SEND_ONE_TESTMAIL) { $success = sendEmail($id, $address, $user['uniqid'], $user['htmlemail']); } else { $success = sendEmail($id, $address, $user['uniqid'], 1) && sendEmail($id, $address, $user['uniqid'], 0); } }
++$done; reset($_SESSION['export']['cols']); while (list($key, $val) = each($_SESSION['export']['cols'])) { fwrite($exportfile, strtr($user[$val], $col_delim, ',') . $col_delim); } reset($attributes); while (list($key, $val) = each($attributes)) { $value = UserAttributeValue($user['id'], $val['id']); fwrite($exportfile, quoteEnclosed($value, $col_delim, $row_delim) . $col_delim); } if ($exporthistory) { fwrite($exportfile, quoteEnclosed($user['ip'], $col_delim, $row_delim) . $col_delim); fwrite($exportfile, quoteEnclosed($user['summary'], $col_delim, $row_delim) . $col_delim); fwrite($exportfile, quoteEnclosed($user['detail'], $col_delim, $row_delim) . $col_delim); } $lists = Sql_query("select listid,name from\n {$tables['listuser']},{$tables['list']} where userid = " . $user['id'] . " and\n {$tables['listuser']}.listid = {$tables['list']}.id {$listselect_and}"); if (!Sql_Affected_rows($lists)) { fwrite($exportfile, 'No Lists'); } while ($list = Sql_fetch_array($lists)) { fwrite($exportfile, stripslashes($list['name']) . '; '); } fwrite($exportfile, $row_delim); } print '<script type="text/javascript"> var parentJQuery = window.parent.jQuery; parentJQuery("#progressbar").updateProgress("' . $todo . ',' . $todo . '"); parentJQuery("#busyimage").hide(); parentJQuery("#progresscount").html("' . s('All done') . '"); </script>'; flush();
if ($total > MAX_USER_PP) { $paging = simplePaging("admins{$remember_find}", $start, $total, MAX_USER_PP, $GLOBALS['I18N']->get('Administrators')); } $limit = ''; if ($total > MAX_USER_PP) { if (isset($start) && $start) { $limit = "limit {$start}," . MAX_USER_PP; } else { $limit = 'limit 0,50'; $start = 0; } } if ($find) { $result = Sql_query('SELECT id,loginname,email FROM ' . $tables['admin'] . ' where loginname like "%' . sql_escape($find) . '%" or email like "%' . sql_escape($find) . "%\" order by loginname {$limit}"); } else { $result = Sql_query('SELECT id,loginname,email FROM ' . $tables['admin'] . " order by loginname {$limit}"); } ?> <table> <tr> <td colspan=4><?php echo formStart('action=""'); ?> <input type="hidden" name="id" value="<?php echo $listid; ?> "> <?php echo $GLOBALS['I18N']->get('Find an admin'); ?> : <input type=text name="find"
/** Renvoie la liste des interdictions ayant les données passées en argument sous forme d'un tableau @param id_groupe @param adresse_ip ... */ function Interdictions_chercher($adresse_ip = '') { $RESULT = array(); $sql = " SELECT *\n\t\t\t\tFROM " . $GLOBALS['prefix'] . "sys_ip_interdictions\n\t\t\t\tWHERE 1"; if ($id_groupe == "" && $adresse_ip == "") { return $RESULT; } $condition = ""; if ($adresse_ip != "" && $adresse_ip != "*") { $condition .= " AND adresse_ip LIKE '%{$adresse_ip}%' "; } $sql .= $condition; $result = Sql_query($sql); if ($result && Sql_errorCode($result) === "00000") { $indice = 0; while ($row = Sql_fetch($result)) { $RESULT[$indice]["nom_utilisateur"] = $row['nom_utilisateur']; $RESULT[$indice]["adresse_ip"] = $row['adresse_ip']; $RESULT[$indice]["nb_tentatives"] = $row['nb_tentatives']; $RESULT[$indice]["date_add"] = $row['date_add']; $RESULT[$indice]["date_upd"] = $row['date_upd']; $indice++; } } return $RESULT; }
if ($GLOBALS['require_login'] && !isSuperUser()) { $access = accessLevel('import1'); switch ($access) { case 'owner': $subselect = ' where owner = ' . $_SESSION['logindetails']['id']; break; case 'all': $subselect = ''; break; case 'none': default: $subselect = ' where id = 0'; break; } } $result = Sql_query('SELECT id,name FROM ' . $tables['list'] . "{$subselect} ORDER BY listorder"); $c = 0; if (Sql_Affected_Rows() == 1) { $row = Sql_fetch_array($result); printf('<input type="hidden" name="listname[%d]" value="%s"><input type="hidden" name="importlists[%d]" value="%d">' . $GLOBALS['I18N']->get('adding_users') . ' <b>%s</b>', $c, stripslashes($row['name']), $c, $row['id'], stripslashes($row['name'])); } else { print '<h3>' . s('Select the lists to add the emails to') . '</h3>'; print ListSelectHTML($import_lists, 'importlists', $subselect); } ?> <script language="Javascript" type="text/javascript"> var fieldstocheck = new Array(); var fieldnames = new Array();
public function store($itemid, $fielddata, $value, $table) { Sql_query(sprintf('replace into %s values("%s",%d,"%s")', $table, $fielddata['name'], $itemid, $this->getDate($value))); }