• hi there,

    looking for a way to replace the ‘private’ label at private posts by an image… who knows where i have to change the code? or is there a plug for modifications or extended administration on private posts. couldn′t find anything so far.

    thank you!

Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter eyetag

    (@eyetag)

    nobody using this feature different from default layout/style… please, i know you′re there!

    grts,
    et

    Thread Starter eyetag

    (@eyetag)

    plz!!! need to make it happen soon…

    Hi, I’m looking for this same thing, can anyone help point me to where the code needs to be changed?

    Thanks!

    Did you search the code for ‘private’?

    My guess would be it’s up to the theme/template to prefix something like that to a post’s output…

    -d

    I’ve created a plugin for this.
    You can find it here:
    https://www.cjbonline.org/index.php/2006/02/07/first-plugin/

    Thanks.

    I’ve updated my plugin to version .5

    This new version adds lots of new features.

    The biggest one is a management page for all private posts. This page is listed under the “Manage” admin menu and is caleld “PrivatePosts” this page allows you to view all the private posts and to mass update them to change them to Public posts.

    I’ve also added a function called “show_private_posts()” which you can see in action on the left menu bar under “Recent Privates”. This function uses the WordPress options of “Posts Per Page” and “What to Show” to show the most recent private posts. If there are no private posts it will not print anyting (Not even the header).

    Lastly, I’ve made some updates to the original function of this plugin, I’ve added a variable called the ‘$Private_Indicator’ which makes it easy to change what the main page indicator is. IE, you can change it to an img, etc.

    You can find the new plugin here.

    Happy Hacking! ??

    Thread Starter eyetag

    (@eyetag)

    black, i′ll get

    WordPress database error: [Unknown table ‘b2posts’ in field list]
    SELECT b2posts.id AS id, post_title, display_name, date_format(post_date, ‘%Y/%m/%d’) as post_date FROM wp_2_posts INNER JOIN wp_2_users ON wp_2_users.id = wp_2_posts.post_author WHERE post_status = ‘private’ ORDER BY post_date DESC

    on my wp 2.0 installation?!
    also, i can′t find a place, where i can configure what private labeling schould apear. from what i can see, you only add another
    ‘- private’ prefix? how can i replace it by an image?
    thanks for the coding!

    Haha, my bad. I hard coded my table name in one place.

    At the top of the file there are two variables you need to set:
    $MyPrivateCat = 2;
    $Private_Indicator = ” – Private”;

    The first one should be set to the category ID of the cat you use as your private category or you can set it to 0 to only list the ‘private’ posts.

    The Private_Indicator is where you set the indicator. IE you can change it to be:
    <img src=\”https://mysite.com/private_post.jpg\”>
    for a picture.

    Thanks.

    Thread Starter eyetag

    (@eyetag)

    hi there,

    i included this
    $MyPrivateCat = 0;
    $Private_Indicator = "<img src="../wp-admin/images/private.gif">";
    $original_title = $title;′

    in the function privatize_the_title($title)

    but i gives me back this kind of dissorted code
    [...] rel="bookmark" title="Permanent Link to no comment<strong><img src=" ../wp-admin/images/private.gif=""> ">no comment</strong><strong><img src="../wp-admin/images/private.gif"></strong>

    so, it adds an unneeded “> infront of the posts title (here ‘no comment’):
    “>no comment

    -> ???

    You need to escape the quotes in the <img src> tag. Like this: ‘\”‘

    Download the new version: https://cjbonline.org/privatepost.txt
    to see an example.

    Thread Starter eyetag

    (@eyetag)

    sorry, mate, but it still won′t work.
    here′s my html output, maybe it′s something in my theme?

    <h1 id="post-13"><a href="https://[path removed]/" rel="bookmark" title="Permanent Link to Du bist Du!<strong> - <img src=" https://www.cjbonline.org/wordpress/wp-admin/images/icon_private.gif=""> ">Testpost!<strong> - <img src="https://www.cjbonline.org/wordpress/wp-admin/images/icon_private.gif"></strong> </a></h1>

    php looks like that
    <h1 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1>

    Could you explain exactly what’s not working?

    Based on the HTML, it looks right, there’s the little mess up where you use the_title() for the title of the link.. Maybe you should try getting rid of that and test it.

    Good luck.

    Thread Starter eyetag

    (@eyetag)

    works now, don′t you know a way how i can keep my permalinks link? something else i just discovered: in archive pages and single.php the private labeling is not listed…

    If you’re going to use an image then there’s really no way to make it work. Because when you call the_title() it doesn’t know WHERE you are calling it from. Since you are trying to insert an image that has “‘s in it, inside of something that’s already “ed, then it won’t work.

    I’ll look into this single.php and archive pages problem?

    I’ve updated the plugin to use an options page to set the options instead of making you change the php page. This should assist in the mess of the img src confusion.

    You can find it here.
    https://www.cjbonline.org/privatepost.txt

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘‘private’ labeling’ is closed to new replies.