Smartor Photo Album - Aktuelle Bilder auf der Startseite

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
Maffy
Mitglied
Beiträge: 158
Registriert: 16.07.2002 17:14
Wohnort: Steinach
Kontaktdaten:

Smartor Photo Album - Aktuelle Bilder auf der Startseite

Beitrag von Maffy »

Ich möchte die Aktuellesten Bilder aus der Bilder Galerie auf der Startseite anzeigen lassen.

Was soweit auch funktioniert. Link zum Forum

Allerdings zeigt er mir offenbar immer nur die Bilder aus der 1 Kategorie an. er soll dies aber Unabhängig von der Kategorie alle neuen Bilder anzeigen wie im aktuelle öfentliche Bilder.

Kann mir da jemand weiter helfen?

Code: Alles auswählen

// Recent Topic

$album_root_path = $phpbb_root_path . 'album_mod/';

//
// Get general album information
//
include($album_root_path . 'album_common.'.$phpEx);

$allowed_cat = '1';

	$sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments
			FROM ". ALBUM_TABLE ." AS p
				LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id
				LEFT JOIN ". ALBUM_CAT_TABLE ." AS ct ON p.pic_cat_id = ct.cat_id
				LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id
				LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id
			WHERE p.pic_cat_id IN ($allowed_cat) AND ( p.pic_approval = 1 OR ct.cat_approval = 0 )
			GROUP BY p.pic_id
			ORDER BY pic_time DESC
			LIMIT ". $album_config['cols_per_page'];
	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not query recent pics information', '', __LINE__, __FILE__, $sql);
	}

	$recentrow = array();

	while( $row = $db->sql_fetchrow($result) )
	{
		$recentrow[] = $row;
	}


	if (count($recentrow) > 0)
	{
		for ($i = 0; $i < count($recentrow); $i += $album_config['cols_per_page'])
		{
			$template->assign_block_vars('recent_pics', array());

			for ($j = $i; $j < ($i + $album_config['cols_per_page']); $j++)
			{
				if( $j >= count($recentrow) )
				{
					break;
				}

				if(!$recentrow[$j]['rating'])
				{
					$recentrow[$j]['rating'] = $lang['Not_rated'];
				}
				else
				{
					$recentrow[$j]['rating'] = round($recentrow[$j]['rating'], 2);
				}

				$template->assign_block_vars('recent_pics.recent_col', array(
					'U_PIC' => ($album_config['fullpic_popup']) ? append_sid("album_pic.$phpEx?pic_id=". $recentrow[$j]['pic_id']) : append_sid("album_page.$phpEx?pic_id=". $recentrow[$j]['pic_id']),
					'THUMBNAIL' => append_sid("album_thumbnail.$phpEx?pic_id=". $recentrow[$j]['pic_id']),
					'DESC' => $recentrow[$j]['pic_desc']
					)
				);

				if( ($recentrow[$j]['user_id'] == ALBUM_GUEST) or ($recentrow[$j]['username'] == '') )
				{
					$recent_poster = ($recentrow[$j]['pic_username'] == '') ? $lang['Guest'] : $recentrow[$j]['pic_username'];
				}
				else
				{
					$recent_poster = '<a href="'. append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $recentrow[$j]['user_id']) .'">'. $recentrow[$j]['username'] .'</a>';
				}

				$template->assign_block_vars('recent_pics.recent_detail', array(
					'TITLE' => $recentrow[$j]['pic_title'],
					'POSTER' => $recent_poster,
					'TIME' => create_date($board_config['default_dateformat'], $recentrow[$j]['pic_time'], $board_config['board_timezone']),

					'VIEW' => $recentrow[$j]['pic_view_count'],

					'RATING' => ($album_config['rate'] == 1) ? ( '<a href="'. append_sid("album_rate.$phpEx?pic_id=". $recentrow[$j]['pic_id']) . '">' . $lang['Rating'] . '</a>: ' . $recentrow[$j]['rating'] . '<br />') : '',

					'COMMENTS' => ($album_config['comment'] == 1) ? ( '<a href="'. append_sid("album_comment.$phpEx?pic_id=". $recentrow[$j]['pic_id']) . '">' . $lang['Comments'] . '</a>: ' . $recentrow[$j]['comments'] . '<br />') : '',

					'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($recentrow[$j]['pic_user_ip']) . '" target="_blank">' . decode_ip($recentrow[$j]['pic_user_ip']) .'</a><br />' : ''
					)
				);
			}
		}
	}
	else
	{
		//
		// No Pics Found
		//
		$template->assign_block_vars('no_pics', array());
	}

/*
+----------------------------------------------------------
| Start output the page
+----------------------------------------------------------
*/

$page_title = $lang['Album'];

$template->set_filenames(array(
	'recent' => 'album_recent_index.tpl')
);
Leben und Leben lassen.
Maffy
Mitglied
Beiträge: 158
Registriert: 16.07.2002 17:14
Wohnort: Steinach
Kontaktdaten:

Beitrag von Maffy »

Hat sich erledigt

Dieser teil muss weg dan zeigt er die neuen Bilder an.

Code: Alles auswählen

p.pic_cat_id IN ($allowed_cat) AND
Mfg Maffy
Leben und Leben lassen.
Benutzeravatar
celsius
Mitglied
Beiträge: 43
Registriert: 08.12.2004 13:24
Wohnort: nahe Hildesheim

Beitrag von celsius »

Sieht gut aus :D

Gibt es einen kompletten Mod dazu?

Danke und Gruß!
Benutzeravatar
Markus67
Ehrenadmin
Beiträge: 28346
Registriert: 12.01.2004 16:02
Wohnort: Neuss
Kontaktdaten:

Beitrag von Markus67 »

Hi ...

den gibts hier ... mit vielen Features :wink:
[ADD-ON] Photo Album Block v1.0.1

Markus
Maffy
Mitglied
Beiträge: 158
Registriert: 16.07.2002 17:14
Wohnort: Steinach
Kontaktdaten:

Beitrag von Maffy »

Oha, da hätte ich mir die Arbeit das selber zumachen sparen können.

Naja, macht nix. :P

Ich werde den Code in den nächsten Tagen in meinem Downloadbereich reinstellen.

http://www.mr-73.de/
Leben und Leben lassen.
Maffy
Mitglied
Beiträge: 158
Registriert: 16.07.2002 17:14
Wohnort: Steinach
Kontaktdaten:

Beitrag von Maffy »

Hier gibt es das teil zum Downloaden:

album_new_pic

:P MFG Maffy
Leben und Leben lassen.
Antworten

Zurück zu „phpBB 2.0: Mod Support“