Beispiel #1
0
function addKeywordLibrary($name) {
  $req = Sql_Query(sprintf('select id from keywordlib where name = "%s"',$name));
  if (Sql_affected_Rows()) {
  	$row = Sql_Fetch_Row($req);
    return $row[0];
  }
  Sql_Query(sprintf('insert into keywordlib (name) values("%s")',$name));
  return Sql_Insert_id();
}
Beispiel #2
0
 //  $formatting_content .= '/>';
 foreach ($GLOBALS['plugins'] as $pluginname => $plugin) {
     $plugins_sendformats = $plugin->sendFormats();
     if (is_array($plugins_sendformats) && count($plugins_sendformats)) {
         foreach ($plugins_sendformats as $val => $desc) {
             $val = preg_replace("/\\W/", '', strtolower(trim($val)));
             if ($val[0] != '_') {
                 ## allow a plugin to add a format that is not actually displayed
                 $formatting_content .= sprintf('%s <input type="radio" name="sendformat" value="%s" %s />', $desc, $val, $messagedata['sendformat'] == $val ? 'checked="checked"' : '');
             }
         }
     }
 }
 $formatting_content .= '</div>';
 $req = Sql_Query("select id,title from {$tables['template']} order by listorder");
 if (Sql_affected_Rows()) {
     $formatting_content .= '<div class="field"><label for="template">' . $GLOBALS['I18N']->get('Use Template') . Help('usetemplate') . '</label>' . '
   <select name="template"><option value="0">-- ' . s('select one') . '</option>
   <option value="0">-- ' . s('No template') . '</option>';
     $req = Sql_Query("select id,title from {$tables['template']} order by listorder");
     while ($row = Sql_Fetch_Array($req)) {
         if ($row['title']) {
             $formatting_content .= sprintf('<option value="%d" %s>%s</option>', $row['id'], $row['id'] == $messagedata['template'] ? 'selected="selected"' : '', $row['title']);
         }
     }
     $formatting_content .= '</select></div>';
 }
 $formatting_content .= '</div>';
 #0013076: different content when forwarding 'to a friend'
 $maincontent .= '<div id="messagecontent" class="field"><label for="message">' . s('Compose Message') . Help('message') . '</label> ';
 $forwardcontent .= '<div id="messagecontent" class="field"><label for="forwardmessage">' . s('Compose Message') . Help('forwardmessage') . '</label> ';
Beispiel #3
0
foreach ($GLOBALS['bounceruleactions'] as $action => $desc) {
    printf('<option value="%s" %s>%s</option>', $action, $data['action'] == $action ? 'selected' : '', $desc);
}
print '</select></td></tr>';
printf('<tr><td>%s</td><td><select name="status">', $GLOBALS['I18N']->get('Status'));
printf('<option value="none">[%s]</option>', $GLOBALS['I18N']->get('Select Status'));
foreach (array('active', 'candidate') as $type) {
    printf('<option value="%s" %s>%s</option>', $type, $data['status'] == $type ? 'selected' : '', $GLOBALS['I18N']->get($type));
}
print '</select></td></tr>';
printf('<tr><td colspan=2>%s</td></tr><tr><td colspan=2>
  <textarea name="comment" rows=10 cols=65>%s</textarea></td></tr>', $GLOBALS['I18N']->get('Memo for this rule'), htmlspecialchars($data['comment']));
print '<tr><td colspan=2><input type=submit name="save" value="' . $GLOBALS['I18N']->get('Save Changes') . '"></td></tr>';
print '</table></form>';
$req = Sql_Query(sprintf('select * from %s where regex = %d', $GLOBALS['tables']['bounceregex_bounce'], $_GET['id']));
$num = Sql_affected_Rows();
if ($num) {
    print '<p>' . $GLOBALS['I18N']->get('related bounces') . '</p><p>';
} else {
    print '<p>' . $GLOBALS['I18N']->get('no related bounces found') . '</p>';
}
$c = 0;
while ($row = Sql_Fetch_Array($req)) {
    print PageLink2('bounce&id=' . $row['bounce'], $row['bounce']) . ' ';
    $c++;
    if ($c > 100) {
        break;
    }
}
if ($c < $num) {
    printf(' ' . $GLOBALS['I18N']->get('and more, %d in total'), $num);