Exemple #1
0
EOT;
// Loop through the database content
foreach ($newsletter_categories_db as $category_loop => $row) {
    if ($row['open_for_subscription'] == 'YES') {
        $open_for_subscription = 'checked="checked"';
    } else {
        $open_for_subscription = '';
    }
    if ($row['public_view'] == 'YES') {
        $publicly_viewable = 'checked="checked"';
    } else {
        $publicly_viewable = '';
    }
    // Get the number of mailings for this category
    $mailings_count = newsletter_mailings_per_category($row['category_id']);
    $number_of_subscriptions = newsletter_subscriptions_per_category($row['category_id']);
    $newsletter_frequency_options = newsletter_frequency_options($row['frequency_year']);
    echo <<<EOT
\t<tr>
\t\t<td align="center">
\t\t\t<input type="hidden" name="cat_id[{$loopCounter}]" value="{$row['category_id']}" />
\t\t\t<input type="checkbox" name="delete[{$loopCounter}]" id="delete{$loopCounter}" value="1" class="checkbox" onclick="if (this.checked) return confirm('{$lang_plugin_newsletter['category_delete_confirmation']}');" />
\t\t</td>
\t\t<td>
\t\t\t<input type="text" name="name[{$loopCounter}]" id="name{$loopCounter}" class="textinput" size="20" maxlength="100" value="{$row['name']}" />
\t\t</td>
\t\t<td>
\t\t\t<textarea name="description[{$loopCounter}]" id="description{$loopCounter}" rows="1" cols="40" class="textinput elastic" style="max-height:200px;">{$row['description']}</textarea>
\t\t</td>
\t\t<td>
\t\t\t<input type="checkbox" name="open_for_subscription[{$loopCounter}]" id="open_for_subscription{$loopCounter}" value="1" class="checkbox" {$open_for_subscription} />
Exemple #2
0
\t<tr>
\t\t<td valign="top" colspan="3" class="tableb">
\t\t\t{$browse_by_category_output}
\t\t</td>
\t</tr>
EOT;
} elseif ($mailing != '') {
    // Display an individual mailing
    $result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PREFIX']}plugin_newsletter_mailings WHERE mailing_id='{$mailing}' LIMIT 1");
    $mailing_array = mysql_fetch_assoc($result);
    mysql_free_result($result);
    $result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PREFIX']}plugin_newsletter_categories WHERE category_id='{$mailing_array['category_id']}' LIMIT 1");
    $category_array = mysql_fetch_assoc($result);
    mysql_free_result($result);
    $date_sent = localised_date($mailing_array['date_sent'], $lang_date['comment']);
    $number_of_subscriptions = newsletter_subscriptions_per_category($mailing_array['category_id']);
    if ($number_of_subscriptions == 1) {
        $number_of_subscriptions = $lang_plugin_newsletter['one_subscription'];
    } else {
        $number_of_subscriptions = sprintf($lang_plugin_newsletter['x_subscriptions'], $number_of_subscriptions);
    }
    if ($category_array['public_view'] == 'YES' || GALLERY_ADMIN_MODE) {
        // It's allowed to display that category
        echo <<<EOT
\t<tr>
\t\t<td valign="top" class="tableb">
\t\t\t{$lang_plugin_newsletter['subject']}
\t\t</td>
\t\t<td valign="top" colspan="2" class="tableb">
\t\t    <strong>{$mailing_array['subject']}</strong>
\t\t</td>