Not Reviewed
Show More
Add another comment
| @@ -59,8 +59,6 if( $_POST ) { | |||||
|
|
59 |
|
59 | ||
|
|
60 | adminhead('Edit Page'); |
|
60 | adminhead('Edit Page'); |
|
|
61 | adminmenu('manage-pages.php'); |
|
61 | adminmenu('manage-pages.php'); |
|
|
62 |
|
|||
|
|
63 |
|
|||
|
|
64 | ?> |
|
62 | ?> |
|
|
65 |
|
63 | ||
|
|
66 | <script language="javascript" type="text/javascript" src="include/tiny_mce/tiny_mce.js"></script> |
|
64 | <script language="javascript" type="text/javascript" src="include/tiny_mce/tiny_mce.js"></script> |
| @@ -80,7 +78,7 tinyMCE.init({ | |||||
|
|
80 | theme_advanced_blockformats : "p,h3,h4,h5,h6", |
|
78 | theme_advanced_blockformats : "p,h3,h4,h5,h6", |
|
|
81 | theme_advanced_resizing : true, |
|
79 | theme_advanced_resizing : true, |
|
|
82 | theme_advanced_styles : "Spoiler=spoiler" |
|
80 | theme_advanced_styles : "Spoiler=spoiler" |
|
|
83 |
|
81 | ||
|
|
84 | }); |
|
82 | }); |
|
|
85 | </script> |
|
83 | </script> |
|
|
86 |
|
84 | ||
| @@ -118,7 +118,7 if( $_POST ) { | |||||
|
|
118 | foreach($_POST['delete_attachment'] as $attachment) |
|
118 | foreach($_POST['delete_attachment'] as $attachment) |
|
|
119 | deleteattachment($attachment); |
|
119 | deleteattachment($attachment); |
|
|
120 |
|
120 | ||
|
|
121 |
$existing_attachments = $ |
|
121 | $existing_attachments = $dbConnection->fetchAll('SELECT ra.id AS id, extension FROM rant_attachment ra JOIN media_t ON ra.media = media_t.id WHERE ra.rant = ? ORDER BY id', array($rant->id)); |
|
|
122 | for($i = 0; $i < count($existing_attachments); $i++) { |
|
122 | for($i = 0; $i < count($existing_attachments); $i++) { |
|
|
123 | $rant->body = preg_replace('/(href|src)=\"([^\"]*?)\\{'.($i+1).'\\}(.*?)\"/', '\1="'.get_rantattachment_filename($existing_attachments[$i]->id).'"', $rant->body); |
|
123 | $rant->body = preg_replace('/(href|src)=\"([^\"]*?)\\{'.($i+1).'\\}(.*?)\"/', '\1="'.get_rantattachment_filename($existing_attachments[$i]->id).'"', $rant->body); |
|
|
124 | } |
|
124 | } |
| @@ -218,7 +218,7 tinyMCE.init({ | |||||
|
|
218 | <fieldset id="authordiv" class="dbx-box"> |
|
218 | <fieldset id="authordiv" class="dbx-box"> |
|
|
219 | <h3 class="dbx-handle">Author</h3> |
|
219 | <h3 class="dbx-handle">Author</h3> |
|
|
220 | <div class="dbx-content"><select name="rant_author"><?php |
|
220 | <div class="dbx-content"><select name="rant_author"><?php |
|
|
221 |
$contrib = $ |
|
221 | $contrib = $dbConnection->fetchAll('SELECT id, name FROM contributor'); |
|
|
222 | foreach( $contrib as $k=>$v ) { |
|
222 | foreach( $contrib as $k=>$v ) { |
|
|
223 | printf('<option value="%s" %s>%s</option>', htmlentities($v->id, ENT_COMPAT, 'UTF-8'), ( $v->id == $rant->author ? 'selected="selected"' : '' ), htmlentities($v->name) ); |
|
223 | printf('<option value="%s" %s>%s</option>', htmlentities($v->id, ENT_COMPAT, 'UTF-8'), ( $v->id == $rant->author ? 'selected="selected"' : '' ), htmlentities($v->name) ); |
|
|
224 | } ?> |
|
224 | } ?> |
| @@ -324,7 +324,7 tinyMCE.init({ | |||||
|
|
324 | <p>Attach files:</p> |
|
324 | <p>Attach files:</p> |
|
|
325 | <ol id="rant_attachment_list"> |
|
325 | <ol id="rant_attachment_list"> |
|
|
326 | <?php |
|
326 | <?php |
|
|
327 |
$attachments = $ |
|
327 | $attachments = $dbConnection->fetchAll('SELECT ra.id AS id, extension FROM rant_attachment ra JOIN media_t ON ra.media = media_t.id WHERE ra.rant = ? ORDER BY id', array($rant->id)); |
|
|
328 | foreach($attachments as $k=>$v) |
|
328 | foreach($attachments as $k=>$v) |
|
|
329 | printf('<li><input type="checkbox" name="delete_attachment[]" value="%d" /> <a href="%s/%s/%s">%s</a></li>', $v->id, SITE_HOST, SITE_PATH, get_rantattachment_filename($v->id), get_rantattachment_filename($v->id)); |
|
329 | printf('<li><input type="checkbox" name="delete_attachment[]" value="%d" /> <a href="%s/%s/%s">%s</a></li>', $v->id, SITE_HOST, SITE_PATH, get_rantattachment_filename($v->id), get_rantattachment_filename($v->id)); |
|
|
330 | ?> |
|
330 | ?> |
| @@ -17,10 +17,10 $page = 1; | |||||
|
|
17 | if( isset($_GET['page'] )) $page = (int) $_GET['page']; |
|
17 | if( isset($_GET['page'] )) $page = (int) $_GET['page']; |
|
|
18 |
|
18 | ||
|
|
19 | $perpage = 15; |
|
19 | $perpage = 15; |
|
|
20 | $start = ($page-1) * $perpage; |
|
20 | $start = ($page - 1) * $perpage; |
|
|
21 |
|
21 | ||
|
|
22 |
$total = ceil( $ |
|
22 | $total = ceil( $dbConnection->fetchColumn('SELECT COUNT(url_name) FROM static_page') / $perpage ); |
|
|
23 |
$pages = $ |
|
23 | $pages = $dbConnection->fetchAll('SELECT url_name, pubdate, status, title, body FROM static_page ORDER BY url_name ASC LIMIT ?, ?', array($start, $perpage)); |
|
|
24 |
|
24 | ||
|
|
25 | pagination( $page, $total ); |
|
25 | pagination( $page, $total ); |
|
|
26 |
|
26 | ||
| @@ -17,10 +17,10 $page = 1; | |||||
|
|
17 | if( isset($_GET['page'] )) $page = (int) $_GET['page']; |
|
17 | if( isset($_GET['page'] )) $page = (int) $_GET['page']; |
|
|
18 |
|
18 | ||
|
|
19 | $perpage = 15; |
|
19 | $perpage = 15; |
|
|
20 | $start = ($page-1) * $perpage; |
|
20 | $start = ($page - 1) * $perpage; |
|
|
21 |
|
21 | ||
|
|
22 |
$total = ceil( $ |
|
22 | $total = ceil( $dbConnection->fetchColumn('SELECT COUNT(id) FROM rant') / $perpage ); |
|
|
23 | $rants = $mtdb->getAll("SELECT r.id,UNIX_TIMESTAMP(r.published) AS published,c.name,r.title,r.body, r.status FROM rant r,contributor c WHERE c.id=r.author GROUP BY id ORDER BY id DESC LIMIT $start,$perpage"); |
|
23 | $rants = $dbConnection->fetchAll('SELECT r.id, UNIX_TIMESTAMP(r.published) AS published, c.name, r.title, t.body, r.status FROM rant r JOIN contributor c ON r.author = c.id ORDER BY r.id DESC LIMIT ?, ?', array($start, $perpage)); |
|
|
24 |
|
24 | ||
|
|
25 | pagination( $page, $total ); |
|
25 | pagination( $page, $total ); |
|
|
26 |
|
26 | ||
| @@ -11,7 +11,7 auth_redirect(); // Require logged in user to access this page. | |||||
|
|
11 | adminhead('Write Rant'); |
|
11 | adminhead('Write Rant'); |
|
|
12 | adminmenu('post-rant.php'); |
|
12 | adminmenu('post-rant.php'); |
|
|
13 |
|
13 | ||
|
|
14 |
$rant_image_ext = $ |
|
14 | $rant_image_ext = $dbConnection->fetchColumn('SELECT extension FROM media_t WHERE id = ?', array((int)$currentuser->imagetype)); |
|
|
15 |
|
15 | ||
|
|
16 | ?> |
|
16 | ?> |
|
|
17 |
|
17 | ||
| @@ -58,10 +58,10 tinyMCE.init({ | |||||
|
|
58 | <div class="dbx-content"><select name="rant_side"> |
|
58 | <div class="dbx-content"><select name="rant_side"> |
|
|
59 | <?php |
|
59 | <?php |
|
|
60 | // What side does this author usually post on? |
|
60 | // What side does this author usually post on? |
|
|
61 |
$usual = $ |
|
61 | $usual = $dbConnection->fetchColumn('SELECT side, COUNT(*) AS c FROM rant WHERE author = ? GROUP BY side ORDER BY c DESC LIMIT 1', array((int)$currentuser->id)); |
|
|
62 |
|
62 | ||
|
|
63 | $sides = array('left'=>'Left','right'=>'Right'); |
|
63 | $sides = array('left'=>'Left', 'right'=>'Right'); |
|
|
64 | foreach( $sides as $k=>$v ) { |
|
64 | foreach( $sides as $k => $v ) { |
|
|
65 | printf('<option value="%s" %s>%s</option>', htmlentities($k), ($usual == $k ? 'selected="selected"' : '' ), $v ); |
|
65 | printf('<option value="%s" %s>%s</option>', htmlentities($k), ($usual == $k ? 'selected="selected"' : '' ), $v ); |
|
|
66 | } |
|
66 | } |
|
|
67 | ?> |
|
67 | ?> |
| @@ -71,8 +71,9 tinyMCE.init({ | |||||
|
|
71 | <fieldset id="authordiv" class="dbx-box"> |
|
71 | <fieldset id="authordiv" class="dbx-box"> |
|
|
72 | <h3 class="dbx-handle">Author</h3> |
|
72 | <h3 class="dbx-handle">Author</h3> |
|
|
73 | <div class="dbx-content"><select name="rant_author"><?php |
|
73 | <div class="dbx-content"><select name="rant_author"><?php |
|
|
74 |
$contrib = $ |
|
74 | $contrib = $dbConnection->fetchAll('SELECT id, name FROM contributor'); |
|
|
75 |
foreach( $contrib as $k=>$v ) |
|
75 | foreach( $contrib as $k => $v ) |
|
|
|
76 | { | ||
|
|
76 | printf('<option value="%s" %s>%s</option>', htmlentities($v->id), ( $currentuser->id == $v->id ? 'selected="selected"' : '' ), $v->name ); |
|
77 | printf('<option value="%s" %s>%s</option>', htmlentities($v->id), ( $currentuser->id == $v->id ? 'selected="selected"' : '' ), $v->name ); |
|
|
77 | } ?> |
|
78 | } ?> |
|
|
78 | </select></div> |
|
79 | </select></div> |
Comments 0
You need to be logged in to leave comments.
Login now
