Edit link moved on 'page_main.php'
More modifying for the page_main.php
As in the last post on 'Messages Generated From Actions, I want to move the edit link from the left hand column to the bottom of the post as I have in the posts_main.php.
After moving it I formatted it with a <div class="page-edit-link"> with borders, but when not logged in the borders didn't show and i wanted a separator from the feedback block so I added a border-top to the 'feedback' div to separate.
The code in the 'page_main.php'is: Added before the <div class="clearboth">
<?php
$Item->edit_link( array( // Link to backoffice for editing
'before' => '<div class="page-edit-link">',
'after' => '<div>',
'text' => '#',
'title' => '#',
'class' => '',
'save_context' => true,
) );
?>
Then the <div class="clearboth"> was changed to <div class="comments"> to get a permanent separator, which acts as the bottom border for the edit link when logged in.
The css codes are:
.page-edit-link{
clear:both;
text-align:right;
width:96%;
margin-left:23px;
padding:5px 3px 2px 0;
border-top:1px dotted blue;
}
.comments{
clear:both;
margin-left:23px;
border-top:1px solid blue;
}
Message Generated From Actions on 'page_main.php'
I have modified the Message Action for the page view as it looked out of place to the side. As their is no text in the space above the page title I've moved it here and made it a long and thinner div.
So the changes, in my modified simple_zen, are:
1. page.main.php Insert immediately after <div id="content" class="column">
<?php
// -----MESSAGES GENERATED FROM ACTIONS -----
messages( array(
'block_start' => '<div class="page_action">',
'block_end' => '</div>',
) );
// --END OF MESSAGES GENERATED FROM ACTIONS --
?>
2. stylesheet.css Add the following
.page_action {
border:1px solid black;
background:#ffff66; color:#000000;
text-align:center;
padding:1px;
margin-left:23%;
margin-top:-24px;
}
Sort Message Position
Sort Message Position 'messages generated from actions' box
6th May
- Skins > blood_wine > posts.main.php [lines 149 to 160]
<?php
// -----MESSAGES GENERATED FROM ACTIONS -----
if (47 == 47)
{
messages( array(
'block_start' => '<div class="action_messages">',
'block_end' => '</div>' . $_GET['blog'] ,
) );
}
// --END OF MESSAGES GENERATED FROM ACTIONS --
?>
- The above code is my modified version in that
a) it contains an if statement, so I know I can control the overall block and
b) I have added the blog variable, again to confirm some that the content can be controlled. - The block has been moved to the MetaData div and the problem arises in that ot now appears after every post rather than just the one that has been edited.
- The if statement needs to check that the post is the one that has been updated.
There is a database value of the mod date and this could be compared to the previous date. ie. This would require reading the modified date before it is updated and comparing it. This would read all posts???
Although the the post is updated that is not recorded other than in the modified date, so there is no way the caller can tell it is updated. - So what instigates the message.
An alternative solution is to bring up a single post after editing, which isn't a bad idea- Anyway must search for messages( array(*,*)).It must be in the admin folder
The only reference to messages( is in
inc/_core_template.funcs.php [lines 555 to 560]
function messages( $params = array() )
{
global $Messages;
$Messages->disp( $params['block_start'],
$params['block_end'] );
}
So now find $Messages Oops! 73 files . . .
Ruled out
_adminUI.class.php
_resultsel.class.phpIn reading the above file I can see that I may search for something like:
$Messages->add( T_(*),) so I could look for "Post has been updated"
Found in inc/items/items.ctrl.php : lines 377 to 387]]
// Execute or schedule notifications & pings:
$edited_Item->handle_post_processing();
$Messages->add( T_('Post has been updated.'), 'success' );
// REDIRECT / EXIT
header_redirect( $redirect_to );
// Switch to list mode:
// $action = 'list';
// init_list_mode();
break;
At line 373 before the above there is a reference to edited_Item->ID maybe I can use that.echo ID as Instead of blog
OK modify post.main.php :
{if ($ItemCache->get_by_ID( $p ) == $edited_Item->ID}It could be possible to check that the update time is, for example, less than 10 seconds from now.- The messages( array(*,*) )
- OK Got it so that it only shows on the edited post, but either the edited post should be at the top or it should show only the single_post.php??
Here's the code:
<!-- MESSAGES GENERATED FROM ACTIONS -->
<?php
$url = $_SERVER['HTTP_REFERER'];
$start = strstr($url,'&p=');
$part = substr($start,3);
$end = strpos($part, '&');
$edited = substr($start,3, $end);
if ($Item->ID == $edited)
{
messages( array(
'block_start' => '<div class="action_messages">',
'block_end' => '</div>',
//'block_end' => '' . "Post ID = " . $Item->ID . "<br /> Edited Post ID = " . $edited,
) );
}
?>
<!-- END OF MESSAGES GENERATED FROM ACTIONS -->;
New bullets for bText ul
I didn't like the little arrows for the unordered list, especially as they didn't comeout in IE6 nor did the defauklt bullets; and the whole format was iffy. so I used the same code for both ul and ol and removed .bText ul li:before {
content: "\00BB \0020";
}
I replaced it with an image.
.bText ul{
list-style-image: url( "img/rbc12.gif" )
}
Meta Data and Edit link
28th April
In this simple_zen (modified) skin the Tags Links precede the Edit link and wrap it.
4th May
Note 1. In multiple post the edit css is right-align, but it gets trapped in the left metadata when post is longer than ???? in blUsh ??? but not here in inTro ???
Note 2. Both Tags and Edit are OK and in separate div below the post in inTro????
SORTED: There was a code error on blUsh stylesheet, namely two closing tags.
.post hr {
display: block;
margin-left:16px;
color:#660099; background-color#660099;
}
}
Add Custom html <hr /> tag to post
.post hr {
display: block;
margin-left:16px;
color:#660099; background-color#660099;
}
I only realised later that there was an extra closing bracket which caused an error in the Tags and Edit options.
Code Block Created in css
In order to show the code for moving the sub categories in the Categories list Widget, I had to mod the css to get it from lines of text, albeit in courier, to a boxcode {
display:block;
border:1px solid blue;
padding: 16px;
margin: 16px 30px 16px 10px;
font: 1em 'Courier New', Courier, Fixed;
}
Indent Sub Categories
Managed to indent and lift sub categories via stylesheet:
#sidebar li.widget_core_coll_category_list ul li ul li{
text-align: left;
line-height:1.6em;
list-style-type: none;
border-bottom: none;
margin: -6px 0px 0px 16px;
}
Change colour of sub category links by adding:
#sidebar li.widget_core_coll_category_list ul li ul li a{
color:#666699; background:transparent;
}
