collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 568
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Author Topic: jQuery carousel to make images slide  (Read 3388 times)

0 Members and 1 Guest are viewing this topic.

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
jQuery carousel to make images slide
« on: July 07, 2011, 01:13:34 PM »
Here's a code that was created by one of my good friends on TP.
What I would like help is with to combine my already created gallery script (which nabs the first image from a topic) with google's jQuery carousel script | http://code.google.com/p/jquery-infinite-carousel/ and make it auto-slide until mouse is rolled over along with the left and right arrow buttons. This would basically put my site in the "mission accomplished" stage. ;)

Here's is my already created gallery script:

Code: [Select]
echo '
<center><img src="..//Themes/newbalance_20/images/custom/recent-comics.png" align="center"> ';


// Block to display images embedded in forum posts from a particular board.
// Shows the first image from the first post of most recently active topics.
// Works with Aeva media package. 
// Embedded images must be the first image in the post and within the first 1600 characters (as set in code).
// Use the Aeva url's for the image. For example...
// [img]http://localhost/forum7/MGalleryItem.php?id=5[/img]
// Will ignore topics without an image.
// Tested on SMF2.0RC4, TP1.0RC1, AevaMedia1.4c
// Author: Freddy, Tiny Portal Support.


// ### Configuration ###

// Specify the board(s) that holds the images.  Comma separated.
$include_boards = array(6,33,34,35,46,47,48,49,50,51,52);

// Specify how many images to try and show.
$num_images = 8;

// Specify how many columns the table should have.
$columns = 4;

// ### End Config ###


global $smcFunc, $scripturl;

// Find all the most recent active topics with images in the first post.
$request = $smcFunc['db_query']('substring', '
SELECT
m.subject, m.id_topic,
SUBSTRING(m.body, 1, 1600) AS body
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
WHERE
b.id_board IN ({array_int:include_boards})
AND m.body REGEXP {string:regexp}
ORDER BY t.id_last_msg DESC
LIMIT ' . $num_images,
array(
'include_boards' => $include_boards,
'regexp' => 'MGalleryItem.php\?id=[0-9]+',
)
);

$posts = array();

while ($row = $smcFunc['db_fetch_assoc']($request))
{
$row['body'] = strip_tags($row['body']);

$image_id = '';

if (preg_match("/MGalleryItem.php\?id=[0-9]+/", $row['body'], $matches))
{
if (preg_match("/id=[0-9]+/", $matches[0], $matches))
$image_id = str_replace("id=", "in=", $matches[0]);
}

// Build the array.
$posts[] = array(
'topic' => $row['id_topic'],
'body' => $row['body'],
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '" rel="nofollow">' . $row['subject'] . '</a>',
'image_id' => $image_id,
'image_thumb' => '<img src="' . $scripturl . '?action=media;sa=media;' . $image_id . ';thumb" alt="Comic Book Cover" />'
);
}

$smcFunc['db_free_result']($request);


// Output, style this as you see fit.

$column_count = 0;

echo '
<table style="margin: auto; font-size: 11px" cellspacing="1" cellpadding="10">
<tr>';

foreach($posts as $post)
{
if ($column_count >= $columns)
{
echo '
</tr>
</tr>';

$column_count = 0;
}

echo '
<td style="text-align: center; vertical-align: top;">

' , $post['image_thumb'] , '<br />
<div style="margin: auto;width: 130px">' , $post['link'] , '</div>
</td>';

$column_count++;
}

while ($column_count < $columns)
{
echo '
<td>
</td>';

$column_count++;
}

echo '
</tr>
</table>';
Since Aeva don't support their mod anymore, this place is my only hope so fingers crossed :)

Offline agent47

  • Jr. Member
  • **
  • Posts: 61
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: jQuery carousel to make images slide
« Reply #1 on: July 21, 2011, 08:15:41 AM »
Someone please help me out with this. It would mean a whole lot guys so please...... block geniuses...