Jump to content

Slidedown Effect?


Padgoi

Recommended Posts

Ok, I have this script that shows latest posts on my forum that updates using ajax.  I want to add the Slidedown effect to it, but I'm not sure where to implement it.  Can anyone help with this?

 

Here's the php function that I want to add the Slidedown effect to:

function fetch_latest_replies($read_perms)
{
	$latest_replies = '';

	$this->ipsclass->DB->simple_construct(
		array(
			'select'	=> 't.title, t.tid, t.forum_id, t.last_post, t.last_poster_name, t.last_poster_id, t.views, t.posts as replies, m.mgroup',
			'from'		=> 'topics t left join ' . SQL_PREFIX . 'members m on (m.id = t.last_poster_id)',
			'where'		=> 't.forum_id in (' . $read_perms . ')',
			'order'		=> 't.last_post desc',
			'limit'		=> array(0, $this->ipsclass->vars['_inferno_topxstats_show'])
		)
	);
	$this->ipsclass->DB->simple_exec();

	while ($thread = $this->ipsclass->DB->fetch_row())
	{
		$thread['replies']		= $this->ipsclass->do_number_format($thread['replies']);
		$thread['last_post']		= $this->ipsclass->get_date ($thread['last_post'], 'SHORT' );
		$thread['forum']		= $this->ipsclass->txt_truncate($thread['forum_id']);			
		$thread['views']		= $this->ipsclass->do_number_format($thread['views']);
		$thread['title']		= $this->ipsclass->txt_truncate($thread['title'], $this->ipsclass->vars['_inferno_topxstats_titles']);

		$latest_replies .= $this->ipsclass->compiled_templates[$this->skingroup]->inferno_topxstats_latestreply($thread);
	}
	setTimeout( function() { Effect.SlideDown( $latest_replies, { duration: 0.3 } ); });
	return $latest_replies;
}

 

And here's the SlideDown effect instructions:

Add this to top of file:

<script src="ajax/prototype.js" type="text/javascript"></script>

<script src="ajax/scriptaculous.js" type="text/javascript"></script>

 

Then add this line to where you want the effect to go:

setTimeout( function() { Effect.SlideDown( $latest_replies, { duration: 0.3 } ); });

 

But when I put that function right above the return $latest_replies line, I get a php error. 

Can anyone help with this?  Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.