[RELEASED] Show last topic titles with icon topic

Do you like it?

yes
5
100%
no
0
No votes
 
Total votes : 5

[RELEASED] Show last topic titles with icon topic

Postby Admin on Mon Apr 21, 2008 11:06 am

---------------------------------------------
First Post only(new)
It's a new variant - here

---------------------------------------------
MOD Name: Show last topic titles with icon
MOD Version: 0.1
Author: fiorefrank(Admin), contributor by Primy and it is an his idea
MOD Description: Show last topic titles with icons

Works with: phpBB 3.0

Features:

This mod add the last topic titles with icon if there is one and it cut title if too long but make it visible at all if you put the mounse on

Licence: GPL

Installation Level: Easy
Installation Time: some minutes

Demo <-- just look the sample forum on the top

Step 1
Code: Select all
---------[OPEN]-------
includes/function_display.php

---------[FIND]---------
$last_post_subject = $row['forum_last_post_subject'];
---------[AFTER,ADD] --------------
$last_post_subject_short=str_split(censor_text($last_post_subject) , 25);
if (strlen($last_post_subject) > 25 ) $last_post_subject_short[0] = $last_post_subject_short[0] . " ...";

---------[FIND]---------
'LAST_POST_SUBJECT'      => censor_text($last_post_subject),
---------[AFTER,ADD] --------------
'LAST_POST_SUBJECT_SHORT'   => $last_post_subject_short[0],
'LAST_TOPIC_ICON_IMG'      => get_icon_id_for_post($row['forum_last_post_id']) ,

---------[FIND]---------
?>
---------[BEFORE,ADD] --------------
// Futuresquare.net mod
function get_icon_id_for_post($forum_post_id)
{ global $db;
$sql = "SELECT icons_url, icon_id FROM " . POSTS_TABLE . " AS p
   LEFT JOIN " . ICONS_TABLE . " AS i ON (i.icons_id = p.icon_id)
   WHERE post_id = '$forum_post_id'" ;
$result = $db->sql_query($sql);
$data = $db->sql_fetchrow($result);
//$db->sql_freeresult($result);
if ($data['icon_id'])
$imm = "<img src=images/icons/" . $data['icons_url'] ." >";
else $imm = "";
return $imm;
}
/////

Step 2
Code: Select all
---------[OPEN]-------
styles/prosilver/template/forumlist_body.html

---------[FIND]---------
{L_POST_BY_AUTHOR}

---------[BEFORE,ADD] --------------
<a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LAST_TOPIC_ICON_IMG}{forumrow.LAST_POST_SUBJECT_SHORT}</a><br>
we don't see things like they are but we see them like we are
User avatar
Admin
Site Admin
Site Admin
 
Posts: 113
Joined: Wed Mar 05, 2008 6:31 am
Location: Internet
Highscores: 6

google adsense
Google
 

Re: [BETA] Enable last topic titles with icon topic

Postby Primy on Mon Apr 21, 2008 11:49 pm

Sei semplicemente un grande! :D
User avatar
Primy
Moderator
Moderator
 
Posts: 60
Joined: Sun Apr 20, 2008 3:16 pm
Highscores: 8

Re: [BETA] Show last topic titles with icon topic

Postby Primy on Sun Jun 01, 2008 2:45 pm

Resuscito il topic per rivolgere una richiesta di modifica a questa mod, che credo interesserà tutti. E' possibile fare in modo che l'icona sull'index, non sia quella dell'ultimo post ma bensi quella del primo post dell'ultimo topic?
Mi spiego meglio. Per com'è adesso la mod, se io inserisco un icona nell'oggetto, ma l'utente replica dopo di me senza icona, sull'index sparirà anche la mia. Se invece la query richiama sempre l'icona del primo post, sull'index rimarrà l'immagine fino a che non arriverà un topic più recente.

Se la cosa non è chiara sono a disposizione Frank! ;)
User avatar
Primy
Moderator
Moderator
 
Posts: 60
Joined: Sun Apr 20, 2008 3:16 pm
Highscores: 8

Re: [BETA] Show last topic titles with icon topic

Postby Admin on Mon Jun 02, 2008 9:25 pm

Chiarissima!!!
Ottima osservazione come sempre ;)
Appena posso la modifico ;)
we don't see things like they are but we see them like we are
User avatar
Admin
Site Admin
Site Admin
 
Posts: 113
Joined: Wed Mar 05, 2008 6:31 am
Location: Internet
Highscores: 6

Re: [RELEASED] Show last topic titles with icon topic

Postby Primy on Mon Oct 27, 2008 8:09 pm

Ciao Frank!

E' da un pò che non mi faccio vivo su Future (anche se cazzeggio parecchio con l'area arcade :mrgreen: ).

Vorrei chiederti se ci sono novità riguardo questa mod. Io ho buttato giù un paio di query ma niente da fare, non sono riuscito ad ottenere la modifica che ti avevo chiesto. Scusa se ti scoccio!

A prestissimo!
User avatar
Primy
Moderator
Moderator
 
Posts: 60
Joined: Sun Apr 20, 2008 3:16 pm
Highscores: 8

[RELEASED] Show last topic titles with icon - First post

Postby Admin on Wed Nov 12, 2008 2:24 am

Hi Primy,
This is the Mod :

Step 1
Code: Select all
---------[OPEN]-------
includes/function_display.php

---------[FIND]---------
$last_post_subject = $row['forum_last_post_subject'];
---------[AFTER,ADD] --------------
$last_post_subject_short=str_split(censor_text($last_post_subject) , 25);
if (strlen($last_post_subject) > 25 ) $last_post_subject_short[0] = $last_post_subject_short[0] . " ...";

---------[FIND]---------
'LAST_POST_SUBJECT'      => censor_text($last_post_subject),
---------[AFTER,ADD] --------------
'LAST_POST_SUBJECT_SHORT'   => $last_post_subject_short[0],
'LAST_TOPIC_ICON_IMG'      => get_icon_id_for_post2($row['forum_id']) ,

---------[FIND]---------
?>
---------[BEFORE,ADD] --------------
// Futuresquare.net mod
function get_icon_id_for_post2($forum_id)
{ global $db;

$sql = "SELECT i.icons_url, p.icon_id FROM " . POSTS_TABLE . " AS p
   LEFT JOIN " . TOPICS_TABLE . " AS t ON (t.forum_id = '$forum_id')
   LEFT JOIN " . ICONS_TABLE . " AS i ON (i.icons_id = p.icon_id)
   WHERE p.post_id = t.topic_first_post_id
   ORDER BY t.topic_last_post_time DESC" ;

$result = $db->sql_query($sql);
$data = $db->sql_fetchrow($result);
//$db->sql_freeresult($result);
if ($data['icon_id'])
$imm = "<img src=images/icons/" . $data['icons_url'] ." >";
else $imm = "";
return $imm;
}
/////


Step two is the same

This is a variant of the first mod and it doesn't replace the first one because somebody can find usefull the first one

Demo is here
we don't see things like they are but we see them like we are
User avatar
Admin
Site Admin
Site Admin
 
Posts: 113
Joined: Wed Mar 05, 2008 6:31 am
Location: Internet
Highscores: 6

google adsense
Google
 

Re: [RELEASED] Show last topic titles with icon topic

Postby Primy on Wed Nov 12, 2008 3:14 am

Great!! Thank you very much mate ;) This is a mod which should be a default feature of phpBB!

Thanks!
User avatar
Primy
Moderator
Moderator
 
Posts: 60
Joined: Sun Apr 20, 2008 3:16 pm
Highscores: 8

Re: [RELEASED] Show last topic titles with icon topic

Postby Primy on Wed Nov 19, 2008 11:41 am

Voglio romperti Frank e fare il pignolo :mrgreen:

Stavo guardando la mod in funzione sul mio sito e mi sono venute in mente due nuove caratteristiche:

La prima è quella di sostituire l'opzione "nessuna (icona), con un icona di default, così in ogni caso sull'index apparirebbe. Sarebbe ancora meglio se l'amministratore potesse scegliere se inserire un icona di default o lasciare le cose così dal modulo in ACP.

La seconda è una semplice funzione che consenta all'amministratore di attivare o disattivare la visualizzazione delle icone sull'index. (Come quella per il viewforum in pratica).

Una volta fatti questi due miglioramenti, la mod sarebbe perfetta! :)
User avatar
Primy
Moderator
Moderator
 
Posts: 60
Joined: Sun Apr 20, 2008 3:16 pm
Highscores: 8

Re: [RELEASED] Show last topic titles with icon topic

Postby Admin on Fri Nov 21, 2008 3:23 pm

Ciao,
per l'immagine di default basta ke modifichi l'else
Ecco un esempio :
Code: Select all
if ($data['icon_id'])
$imm = "<img src=images/icons/" . $data['icons_url'] ." >";
else $imm = "<img src=images/icons/default_image_name";   //devi modificare questa riga
return $imm;


Per le altre richieste le faccio il prima possibile
we don't see things like they are but we see them like we are
User avatar
Admin
Site Admin
Site Admin
 
Posts: 113
Joined: Wed Mar 05, 2008 6:31 am
Location: Internet
Highscores: 6

Re: [RELEASED] Show last topic titles with icon topic

Postby Prozac88 on Fri Dec 19, 2008 9:11 pm

Ciao scusami volevo sapere come faccio a integrare la mod nella mia skin. Per il primo step non c'è problema..ma nel secondo nel file della mia skin non ci sono quei parametri. Potete aiutarmi?
Prozac88
New
New
 
Posts: 2
Joined: Fri Dec 19, 2008 9:03 pm

Next

Return to MOD Reviews

Who is online

Users browsing this forum: No registered users and 0 guests

cron