Recent Topics

1 May 30, 2004 19:01    

i like it to have an edit-button right bellow every entry to have a quick access to the edit function.

first you need to create the file conf/hacks.php if it not exists.
copy this code into the file


function user_admin_edit_link(	
	$page = 'b2edit.php',
	$link_text = 'Edit',
	$link_title = 'Edit this Entry')

{
	global $Item, $current_User, $admin_url;
	if( ! is_logged_in() ) return false;

	if( $current_User->get('level') <= 1 ) 
	{ // If user is NOT active:
		return false;
	}

	$page = 'b2edit.php';
	$link_text = 'Edit';
	$link_title = 'Edit this Entry';
	
	echo ' - <a href="', $admin_url, '/',$page,'?action=edit&amp;post=',$Item->ID;
	echo '&amp;submit=Editieren','"title="',$link_title, '">';
	echo $link_text ;
	echo '</a>';
}

and upload the file (to the conf directory)
now in your skin you can add


<?php user_admin_edit_link();?>

whereever you want. maybe after this line

<a href="<?php $Item->permalink() ?>" title="Permanent link to full entry">Permalink</a>

2 Jun 01, 2004 11:57

lol i did this a long time ago but i didnt have it integrated into the hacks file...

neat...

3 Jun 05, 2004 02:32

Similar functionnality will be integrated in the next "Oslo" release.

It is implemented as methods of $Item and $Comment .

4 Dec 07, 2005 10:24

Old thread, but...

I now have Phoenix, and what I want is a "edit this post" button at the end of every single post, NOT in the backoffice (there already is) but into the blog, near to "leave a comment" and "blahblah".
Of course, it has to be hidden to everyone except me (the admin).
How can I do that?

Thanks,

Francesco

5 Dec 07, 2005 12:38

This is allready default in phoenix.

You can see it in action in the skin nifty corners or my niftycolor-breath

<?php $Item->edit_link( ' &bull; ', ' ',get_icon( 'edit', 'imgtag' ) ) // Link to backoffice for editing ?>
<?php $Item->publish_link( ' &bull; ', ' ',get_icon( 'publish', 'imgtag' ) ) // Link to Publish a not public post ?>	
<?php $Item->deprecate_link( ' &bull; ', ' ',get_icon( 'deprecate', 'imgtag' ) ) // Link to Deprecate a public post ?>	

6 Dec 07, 2005 12:45

uhm, so why I can't see anything (not an icon, nor a link) at the end of each post? I use LEAF skin. (www.silenzi.com is my website)

7 Dec 07, 2005 12:52

You should at least see a bullet..
So I doubt if you uploaded the right file...

8 Dec 07, 2005 12:59

In my _main.php I have found this piece of code:

<div class="itemdetails">
						<span class="item1"><?php $Item->Author->preferred_name() ?> </span>
						<span class="item2"><?php  $Item->categories(); ?></span> 
							<?php link_pages() ?>
						<span class="item3"><?php $Item->feedback_link( 'comments' ) // Link to comments ?></span>
						[color=red]<!--[/color]
							<?php $Item->feedback_link( 'trackbacks', ' &bull; ' ) // Link to trackbacks ?>
							<?php $Item->feedback_link( 'pingbacks', ' &bull; ' ) // Link to trackbacks ?>
							<?php $Item->edit_link( ' &bull; ' ) // Link to backoffice for editing ?>
							[color=red]-->[/color]

					</div>

Maybe it's something wrong with that?

EDIT: F*ck, I didn't notice it was commented out! I didn't remove this piece of code because maybe someone would get the same problem. In this case, just delete the red parts.

9 Dec 07, 2005 13:05

papzadsl wrote:

In my _main.php I have found this piece of code:

<?php $Item->edit_link( ' &bull; ' ) // Link to backoffice for editing ?>

change it to this, and you will see an icon.

<?php $Item->edit_link( ' &bull; ', ' ',get_icon( 'edit', 'imgtag' ) ) // Link to backoffice for editing ?>


Form is loading...