Example #1
0
    $vSrch = new Valid_String('search');
    $vSrch->required();
    if (!$request->valid($vSrch)) {
        // Check if there are archives to browse
        $qry = sprintf('SELECT NULL' . ' FROM plugin_forumml_message' . ' WHERE id_list = %d' . ' LIMIT 1', db_ei($list_id));
        $res = db_query($qry);
        if (db_numrows($res) > 0) {
            // Call to show_thread() function to display the archives
            if (isset($topic) && $topic != 0) {
                // specific thread
                plugin_forumml_show_thread($p, $list_id, $topic, $purgeCache);
            } else {
                plugin_forumml_show_all_threads($p, $list_id, $list_name, $offset);
            }
        } else {
            echo "<H2>" . $GLOBALS["Language"]->getText('plugin_forumml', 'empty_archives') . "</H2>";
        }
    } else {
        // search archives
        $pattern = "%" . $request->get('search') . "%";
        $sql = sprintf('SELECT mh.id_message, mh.value' . ' FROM plugin_forumml_message m, plugin_forumml_messageheader mh' . ' WHERE mh.id_header = %s' . ' AND m.id_list = %d' . ' AND m.id_parent = 0' . ' AND m.id_message = mh.id_message' . ' AND mh.value LIKE "%s"', FORUMML_SUBJECT, db_ei($list_id), db_es($pattern));
        $result = db_query($sql);
        echo "<H3>" . $GLOBALS['Language']->getText('plugin_forumml', 'search_result', $request->get('search')) . " (" . db_numrows($result) . " " . $GLOBALS["Language"]->getText('plugin_forumml', 'found') . ")</H3>";
        if (db_numrows($result) > 0) {
            plugin_forumml_show_search_results($p, $result, $group_id, $list_id);
        }
    }
    mail_footer($params);
} else {
    header('Location: ' . get_server_url());
}
Example #2
0
			<li>
				<a href="' . getStringFromServer('PHP_SELF') . '?group_id=' . $group_id . '&amp;add_list=1">' . _('Add Mailing List') . '</a>
			</li>
		</ul>';
        $mlCount = count($mlArray);
        if ($mlCount > 0) {
            $tableHeaders = array(_('Mailing list'), '', '');
            echo $HTML->listTableTop($tableHeaders);
            for ($i = 0; $i < $mlCount; $i++) {
                $currentList =& $mlArray[$i];
                if ($currentList->isError()) {
                    echo '<tr ' . $HTML->boxGetAltRowStyle($i) . '><td colspan="3">';
                    echo $currentList->getErrorMessage();
                    echo '</td></tr>';
                } else {
                    echo '<tr ' . $HTML->boxGetAltRowStyle($i) . '><td width="60%">' . '<strong>' . $currentList->getName() . '</strong><br />' . htmlspecialchars($currentList->getDescription()) . '</td>' . '<td width="20%" style="text-align:center"><a href="' . getStringFromServer('PHP_SELF') . '?group_id=' . $group_id . '&amp;group_list_id=' . $currentList->getID() . '&amp;change_status=1">' . _('Update') . '</a></td>' . '<td width="20%" style="text-align:center">';
                    if ($currentList->getStatus() == MAIL__MAILING_LIST_IS_REQUESTED) {
                        echo _('Not activated yet');
                    } else {
                        echo '<a href="' . $currentList->getExternalAdminUrl() . '">' . _('Administrate') . '</a></td>';
                    }
                    echo '</tr>';
                }
            }
            echo $HTML->listTableBottom();
        }
        mail_footer(array());
    }
} else {
    exit_no_group();
}
Example #3
0
            mail_footer(array('pv' => isset($pv) ? $pv : false));
            exit;
        }
        echo '<P>' . $Language->getText('mail_index', 'mail_list_via_gnu');
        if ($pv) {
            echo "<P>" . $Language->getText('mail_index', 'choose_and_browse') . "<P>\n";
        } else {
            echo "<TABLE width='100%'><TR><TD>";
            echo "<P>" . $Language->getText('mail_index', 'choose_and_browse') . "<P>\n";
            echo "</TD>";
            echo "<TD align='left'> ( <A HREF='?group_id={$group_id}&pv=1'><img src='" . util_get_image_theme("msg.png") . "' border='0'>&nbsp;" . $Language->getText('global', 'printer_version') . "</A> ) </TD>";
            echo "</TR></TABLE>";
        }
        /*
            Put the result set (list of mailing lists for this group) into a column with folders
        */
        echo "<table WIDTH=\"100%\" border=0>\n" . "<TR><TD VALIGN=\"TOP\">\n";
        for ($j = 0; $j < $rows; $j++) {
            display_ml_details($group_id, $list_server, $result, $j);
        }
        echo '</TD></TR></TABLE>';
    }
} else {
    $params = array('title' => $Language->getText('mail_index', 'choose_group_first'), 'help' => 'communication.html#mailing-lists', 'pv' => $pv);
    mail_header($params);
    require '../mail/mail_nav.php';
    echo '
		<H1>' . $Language->getText('mail_index', 'group_err') . '</H1>';
}
mail_footer(array('pv' => $pv));