2 yabba Feb 28, 2010 18:03

 
 

Hi ¥åßßå,
Thank's for your fast reply!
Could you point me out where to put his code ?
I guess it goes in the advanced search script, or am I way off now ?
Greetz,
Nils

If it was me I'd probably add a custom disp to my blog and a "YOUR COMMENTS" link ( assume they're a smidge myspace :roll: ) link to your sidebar ;)
I'd also probably add a "LIMIT 10" to the sql so they don't get confused by a plethora of links ;)
¥

Sorry ¥åßßå,
I'm stuck right now....
I really don't know how to implement this great function :(
First of all, I don't know how to add a custom disp. Cause: I don't know where to add disp variables
Second, I've made your script a php file, comments.php but that doesn't work either... I'm feeling very nOOby right know, but I want to learn, could you help me a bit more please ?
Thank you so far :)

Lets do this a tad of a different way :
Assuming your skins sidebar looks a tad like this :
<div id="sidebar">
		<ul>
		<?php
			// ------------------------- "Sidebar" CONTAINER EMBEDDED HERE --------------------------
			// Display container contents:
			skin_container( NT_('Sidebar 2'), array(Amend it to look like this :
	<div id="sidebar">
		<ul>
		<?php
		if( is_logged_in() )
		{
			global $DB, $current_User;
			$sql = 'SELECT * FROM T_comments WHERE author_ID='.$current_User->ID.' AND status="published" LIMIT 10';
			if( $uComments = $DB->get_results( $sql, ARRAY_A ) )
			{
				echo '<li>Your last 10 comments</li>'."\n";
				foreach( $uComments as $uComment )
				{
					$tComment = new Comment( $uComment );
					$tComment->get_Item();
					$tComment->permanent_link(array(
							'before' => '<li>',
							'after' => '</li>',
							'text' => $tComment->Item->dget('title'),
						));
				}
			}
		}
			// ------------------------- "Sidebar" CONTAINER EMBEDDED HERE --------------------------
			// Display container contents:
			skin_container( NT_('Sidebar 2'), array(¥

I Still don't know how to do this, I don't know wich files to edit :(

.../skins/your_skin/index.main.php (additionally posts.main.php and single.main.php depending on the skin you are using)

@tiliqicom
I guess that's nor for my skin (intense) u can see it @ http://nujij.org
@¥åßßå
Ik keep getting errors like: unknown status in where "published"
I've changed author_id into comment_author_id, that doesn't help either.
I will keep on trying, but a little hint would really make my day :) Greetz from Holland,
peace

comment_author_id change you did was right, in addition you gotta change status to comment_status so that it looks like this:
        if( is_logged_in() )
        {
            global $DB, $current_User;
            $sql = 'SELECT * FROM T_comments WHERE comment_author_ID='.$current_User->ID.' AND comment_status="published" LIMIT 10';
            if( $uComments = $DB->get_results( $sql, ARRAY_A ) )
            {
                echo '<li>Your last 10 comments</li>'."\n";
                foreach( $uComments as $uComment )
                {
                    $tComment = new Comment( $uComment );
                    $tComment->get_Item();
                    $tComment->permanent_link(array(
                            'before' => '<li>',
                            'after' => '</li>',
                            'text' => $tComment->Item->dget('title'),
                        ));
                }
            }
        } 
Sorry Tilqicom, that doesn't work for me either, the <li> displays but then I get a error: The requested item doesn't exist. :(
It isn't in my index.main.php by the way, but in the sidebar.inc.php
I feel like I'm close, but can't fix it on my own I'm afraid... Maybe I could give you a ftp account to help me? I realize that's not normal to ask, but I've seen I could ask you anything ;) Greetz Nils

it should work, maybe you got that error because you dont have any comments ? i dont know. but i can take a look if you pm me ftp details

enjoy (:

Dear Tilqicom,
thank's again for your effort, you really helped me out on this!
The latest comment script works as expected, only because of a mistake I made earlier it isn't compatible with all users. I've deleted a user in the past and I suspect this has something to do with it, at least with deleted posts who had comments. As you can see, I'm not sure ;)
I now have requested all members to re-register so this problem will be fixed.
I don't know how to thank you, actually I'm unemployed and don;t have social security. In other words: I'm broke ;)
Next month I will receive some money from some adds, and I want to
give you somekind of a symbolic payment. :)
We can keep in touch via my website and our email adresses.
Again, thank you very much!
Greets from Holland,
Nils Peters
[/img]

To share this with other people I've place the code needed here. Put this in your _sidebar.inc.php
?>
<div id="sidebar">
	
    <span id="latestusercomments">
    <ul>
<?php
    if( is_logged_in() )
        {
            global $DB, $current_User;
            $sql = 'SELECT * FROM T_comments WHERE comment_author_ID='.$current_User->ID.' AND comment_status="published" LIMIT 10';
            if( $uComments = $DB->get_results( $sql, ARRAY_A ) )
            {
                echo '<li>Jouw laatste reacties</li>'."\n";
                foreach( $uComments as $uComment )
                {
					echo '<li>';
                    $tComment = new Comment( $uComment );
                    $tComment->get_Item();
                    $tComment->permanent_link(array(
                            'before' => '<li>',
                            'after' => '</li>',
                            'text' => $tComment->Item->dget('title'),
                        ));
					echo'</li>';
                }
            }
        }
?>
</span>
no worries, credit goes to ¥åßßå , i did nothing

ets do this a tad of a different way :
Assuming your skins sidebar looks a tad like this :
*removed

@Charchilp?
I don't get your point, did you smoke as much as I did yesterday ? ;)
Free typed so excuse any errors ;)
¥