<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="ARTICLE @ XOOPS powered by FeedCreator" -->
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="it">
    <title>Xoops Italia :: Articolo</title>
    <tagline>Articolo XML</tagline>
    <link rel="alternate" type="text/html" href="http://www.xoopsitalia.org/modules/article/view.article.php/51/c10"/>
    <id>http://www.xoopsitalia.org/modules/article/view.article.php/51/c10</id>
    <modified>2012-02-04T23:10:33+02:00</modified>
    <author>
        <name>defkon1 at gmail dot com</name>
    </author>
    <generator>ARTICLE @ XOOPS powered by FeedCreator</generator>
    <entry>
        <title>Limitare il numero dei messaggi privati per ogni utente.</title>
        <link rel="alternate" type="text/html" href="http://www.xoopsitalia.org/modules/article/view.article.php/51/c10"/>
        <created>2007-06-26T10:34:55+02:00</created>
        <issued>2007-06-26T10:34:55+02:00</issued>
        <modified>2007-06-26T10:34:55+02:00</modified>
        <id>http://www.xoopsitalia.org/modules/article/view.article.php/51/c10</id>
        <author>
            <name>slyss</name>
        </author>
        <summary>Categoria: Hack per Xoops 2.0.x&lt;br /&gt;Keywords: hack, pm, messaggi, privati, limitare&lt;br /&gt;Riassunto: Questo piccolo hack è utile quando si vuole fare in modo che ogni utente abbia un massimo di X messaggi all'interno della propria casella.Ho scritto questo hack per limitare il numero dei messaggi privati di ogni utente.
&lt;br /&gt;&lt;br /&gt;
Questo hack fa si che se noi (amministratori) impostiamo un massimo di (per esempio) 10 messaggi, i nostri utenti potranno inviare nuovi messaggi privati solamente se avranno meno di 10 messaggi nella propria casella.
&lt;br /&gt;&lt;br /&gt;
Così facendo costringeremo i nostri utenti a &quot;tenere pulita&quot; costantemente la loro casella e quindi a non intasarci il database.
&lt;br /&gt;&lt;br /&gt;
aprite il file che trovate nella root:
&lt;br /&gt;&lt;br /&gt;
&lt;strong&gt;pmlite.php&lt;/strong&gt;
&lt;br /&gt;&lt;br /&gt;
e subito dopo la riga:
&lt;br /&gt;&lt;br /&gt;
&lt;div class=&quot;xoopsCode&quot;&gt;&lt;code&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;
&lt;span style=&quot;color: #0000BB&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;include&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;mainfile.php&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/code&gt;&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
aggiungete questo hack:
&lt;br /&gt;&lt;br /&gt;
&lt;div class=&quot;xoopsCode&quot;&gt;&lt;code&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;
&lt;span style=&quot;color: #0000BB&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//&amp;nbsp;Hack&amp;nbsp;by&amp;nbsp;Stefano&amp;nbsp;Silvestrini&amp;nbsp;limitazione&amp;nbsp;messaggi&amp;nbsp;privati&lt;br /&gt;//&amp;nbsp;aka&amp;nbsp;slyss&amp;nbsp;on&amp;nbsp;xoopsitalia.org&lt;br /&gt;//&amp;nbsp;&lt;a href=&quot;http://www.stefanosilvestrini.com&quot; title=&quot;www.stefanosilvestrini.com&quot; rel=&quot;external&quot;&gt;www.stefanosilvestrini.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$xoopsUser&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&amp;nbsp;{&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$max_messaggi&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//settare&amp;nbsp;questo&amp;nbsp;numero&amp;nbsp;a&amp;nbsp;vostro&amp;nbsp;piacimento&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$xoopsDB&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;query&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;SELECT&amp;nbsp;*&amp;nbsp;FROM&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$xoopsDB&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;prefix&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;'priv_msgs'&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;nbsp;WHERE&amp;nbsp;to_userid&amp;nbsp;=&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$xoopsUser&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;getVar&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;'uid'&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$RowsNum&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$xoopsDB&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;getRowsNum&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cancella&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$RowsNum&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$max_messaggi&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;if(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$RowsNum&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$max_messaggi&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&lt;br /&gt;{&lt;br /&gt;echo&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;br&amp;nbsp;/&amp;gt;&amp;lt;br&amp;nbsp;/&amp;gt;&amp;lt;div&amp;nbsp;align='center'&amp;gt;&amp;lt;div&amp;nbsp;style='text-align:&amp;nbsp;justify;&amp;nbsp;color:&amp;nbsp;white;&amp;nbsp;font-weight:&amp;nbsp;bold;&amp;nbsp;background-color:&amp;nbsp;#ffb7d3;&amp;nbsp;width:&amp;nbsp;70%;&amp;nbsp;padding:&amp;nbsp;15px;&amp;nbsp;vertical-align:&amp;nbsp;middle;'&amp;gt;Mi&amp;nbsp;spiace,&amp;nbsp;hai&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$RowsNum&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;nbsp;messaggi&amp;nbsp;nel&amp;nbsp;tuo&amp;nbsp;profilo.&amp;nbsp;Il&amp;nbsp;numero&amp;nbsp;consentito&amp;nbsp;massimo&amp;nbsp;&amp;amp;egrave;&amp;nbsp;di&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$max_messaggi&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;nbsp;messaggi.&amp;lt;br&amp;nbsp;/&amp;gt;&amp;lt;br&amp;nbsp;/&amp;gt;Cancella&amp;nbsp;almeno&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cancella&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;nbsp;messaggi&amp;nbsp;per&amp;nbsp;poterne&amp;nbsp;inviare&amp;nbsp;ancora.&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;exit();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//&amp;nbsp;fine&amp;nbsp;hack&amp;nbsp;-&amp;nbsp;slyss&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/code&gt;&lt;/code&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
fatto questo, chiudete e salvate.
&lt;br /&gt;&lt;br /&gt;
Ora avrete limitato a 10 (settate la vostra variabile come volete) il numero di messaggi massimi all'interno di ogni casella dei vostri utenti.
&lt;br /&gt;&lt;br /&gt;
Se un utente con più di 10 messaggi proverà ad inviare un nuovo messaggio gli apparirà questa schermata:
&lt;br /&gt;&lt;br /&gt;
&lt;img src='http://www.xoopsitalia.org/uploads/hack-pm.jpg' border='0' alt=''  onload=&quot;javascript:imageResize(this, 300)&quot;/&gt;&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;
(Quest'immagine si riferisce ad un hack settato con al massimo 3 messaggi privati)
&lt;br /&gt;&lt;br /&gt;
ciao sly&lt;br /&gt;</summary>
    </entry>
</feed>

