Example #1
0
<?php

include '../include.php';
url_query_require();
if (url_action('delete')) {
    db_delete('press_clips', $_GET['delete_id']);
    url_change('/press-clips/');
}
echo drawTop();
echo drawTableStart();
echo drawHeaderRow($page['breadcrumbs'] . $page['title'], 2, getString('edit'), 'edit/?id=' . $_GET['id'], getString('delete'), drawDeleteLink());
$r = db_grab('SELECT c.title' . langExt() . ' title, c.url, c.pub_date, c.publication' . langExtT() . ' publication, c.type_id, c.description' . langExt() . ' description, t.title' . langExt() . ' type FROM press_clips c JOIN press_clips_types t ON c.type_id = t.id WHERE c.id = ' . $_GET['id']);
?>
	<tr>
		<td class="left"><?php 
echo getString('title');
?>
</td>
		<td class='title'><?php 
echo $r['title'];
?>
</td>
	</tr>
	<tr>
		<td class="left"><?php 
echo getString('category');
?>
</td>
		<td><?php 
echo draw_link('categories.php?id=' . $r['type_id'], $r['type']);
?>
Example #2
0
            //$r["title"] = str_replace("The Associated Press: ", "", $r["title"]);
        } elseif ($url["domainname"] == "google" && $url["subfolder"] == "afp") {
            $r["publication"] = "AFP";
            $r["title"] = str_replace("Afp: ", "", $r["title"]);
        } elseif ($url["domainname"] == "google" && $url["subfolder"] == "ap") {
            $r["publication"] = "AP";
            $r["title"] = str_replace("The Associated Press: ", "", $r["title"]);
        }
    }
}
//to control return_to redirects.  i'm not sure how i should handle this generally.  it's a problem mainly when the page is included
if ($referrer && $referrer["host"] == $request["host"]) {
    $_josh["referrer"] = false;
}
$f = new form('press_clips', @$_GET['id'], $action);
if (!$included) {
    $f->set_title_prefix($page['breadcrumbs']);
}
$f->set_field(array('name' => 'title' . langExt(), 'type' => 'text', 'label' => getString('title')));
$f->set_field(array('name' => 'url', 'type' => 'text', 'label' => getString('url')));
$f->set_field(array('name' => 'publication' . langExtT(), 'type' => 'text', 'label' => getString('publication')));
$f->set_field(array('name' => 'pub_date', 'type' => 'date', 'label' => getString('published'), 'required' => true));
$f->set_field(array('name' => 'description' . langExt(), 'type' => 'textarea', 'label' => getString('description'), 'class' => 'tinymce'));
$f->set_field(array('name' => 'type_id', 'label' => getString('category'), 'type' => 'select', 'sql' => 'SELECT id, title' . langExt() . ' title FROM press_clips_types ORDER BY precedence', 'required' => true));
formAddChannels($f, 'press_clips', 'clip_id');
langUnsetFields($f, 'title,description,publication');
langTranslateCheckbox($f, url_id());
echo $f->draw(@$r, !$included);
if (!$included) {
    echo drawBottom();
}