Pagina 1 di 1

Mod Download OXPUS

Inviato: 02/05/2014, 1:28
da sakkiotto
Salve,
praticamente questa mod oltre ai permessi di download upload vedere etc.. per gruppo, cè un limite sopratuttto per il minimo di totali messaggi inviati in tot tempo.

ecco vorrei cambiare questa variabile messaggi inviati invece con i punti totali di un utente (senza la questione del tempo, ho ultimate points che ho gia funzionante sul mio forum)

il codice dove fa questo controllo dei totale messaggi inviati è questo

Codice: Seleziona tutto

	* Block downloads for users who must have at least the given number of posts to download a file
		* and tries to download after spamming in the forum more than the needed number of posts in the last 24 hours	
		*/
		if ($user->data['user_posts'] >= $config['dl_posts'] && !$dl_file['extern'] && !$dl_file['free'] && $config['dl_antispam_posts'] && $config['dl_antispam_hours'])
		{
			$sql = 'SELECT COUNT(post_id) AS total_posts FROM ' . POSTS_TABLE . '
				WHERE poster_id = ' . $user->data['user_id'] . '
					AND post_time >= ' . (time() - ($config['dl_antispam_hours'] * 3600));
			$result = $db->sql_query($sql);
			$post_count = $db->sql_fetchfield('total_posts');
			$db->sql_freeresult($result);

			if ($post_count >= $config['dl_antispam_posts'])
			{
				$status = false;
			}
		}

mentre il totale punti nel database stanno nella tabella phpbb_users campo user_points

ho provato varie combinazioni possibili ma non riesco ad uscirene (non sono un programmatore ma ad intuito ci provo eehhe)

spero qualcuno che è sicuramente piu bravo di me, può risolvermi questo problema, disponibile per un bel caffe + cornetto :)

Re: Mod Download OXPUS

Inviato: 02/05/2014, 2:12
da Barrnet
Uhm sapresti la tabella e il campo in cui i punti vengono salvati? Non ho tale mod.

Re: Mod Download OXPUS

Inviato: 02/05/2014, 2:37
da sakkiotto
Ciao Barrnet
i punti sono in phpbb_users --> user_points

cmq ci sono riuscito ho smanettato fino ad adesso ho fatto cosi magari sarà poco pulito come codice ma è funzionante nel mio caso

Codice: Seleziona tutto

/*
		* Antispam-Modul
		*
		* Block downloads for users who must have at least the given number of posts to download a file
		* and tries to download after spamming in the forum more than the needed number of posts in the last 24 hours	
		*/
		if ($user->data['user_points'] >= $config['dl_posts'] && !$dl_file['free'] && $config['dl_antispam_posts'] && $config['dl_antispam_hours'])
		{
			$sql = 'SELECT user_points FROM ' . USERS_TABLE . ' 
			WHERE user_id = ' . $user->data['user_id'];    
                  $result = $db->sql_query($sql);
				  $points_count = $db->sql_fetchfield('user_points');
                  $row = $db->sql_fetchrow($result);
                  $db->sql_freeresult($result);

			if ($points_count >= $config['dl_antispam_posts'])
			{
				$status = false;
			}
		}
poi nel file dl_mod/classes/class_dlmod.php

cerca

Codice: Seleziona tutto

$this->user_posts = $user->data['user_posts'];
sostituisci con

Codice: Seleziona tutto

$this->user_points = $user->data['user_points'];
cerca

Codice: Seleziona tutto

var $user_posts = 0;
sostituisci con questo

Codice: Seleziona tutto

var $user_points = 0;
cerca

Codice: Seleziona tutto

if ($this->user_posts < $config['dl_posts'] && !$this->dl_file[$df_id]['extern'] && !$this->dl_file[$df_id]['free'])
sostituisci con questo

Codice: Seleziona tutto

if ($this->user_points < $config['dl_posts'] && !$this->dl_file[$df_id]['extern'] && !$this->dl_file[$df_id]['free'])
EDIT purtroppo ho chiesto al creator ma non mi ha calcolato ahah perchè praticamente mi serviva che ogni download scalasse di tot punti insomma ci ho perso una settimana però ci vuole pazienza e ahime... io ne ho poca e abbandono subito hehehe . stavolta mi è andata bene

la versione che ho della download mod è (oxpus 6.4.9) in quanto dalle ultime versioni non funzionava l'addon che per ogni download scalasse i punti (stabiliti da ultimate points) di un utente

Re: Mod Download OXPUS

Inviato: 02/05/2014, 3:18
da Barrnet
Ad occhio penso che basti andare nel file .php che gestisce il download, cercare la parte che fornisce il download ed aggiungerci una riga che lanci una query di aggiornamento, sottraendo i punti.

Re: Mod Download OXPUS

Inviato: 03/06/2014, 17:24
da sakkiotto
riprendo questo topic...

allora la mod come abbiamo precedentemente modificato con il discorso punti funziona bene.

se hai punti si vede il tasto download.. altrimenti non lo fa vedere.... (è perfetto)
è possibile invece far compararire un immagine a mia scelta quando non si vede il pulsante download?

il codice è questo sicuramente...

Codice: Seleziona tutto

<!-- BEGIN download_button -->
<div id="dl_mod_button">
<form action="{download_button.U_DOWNLOAD}" method="post" id="download" {download_button.S_DL_WINDOW} onsubmit="hide_dl_button();">

	<table cellpadding="0" cellspacing="0" style="width: 100%">
	<tr>
		<td>
			<!-- IF S_VC -->
			<!-- IF CAPTCHA_TEMPLATE -->
					<!-- DEFINE $CAPTCHA_TAB_INDEX = 8 -->
					<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
			<!-- ENDIF -->
			<!-- ENDIF -->
		</td>
		<td style="text-align: right;">
			{download_button.S_DL_VERSION}<br />
			{ADS_1}
			<input type="image" src="{I_DL_BUTTON}" name="submit" id="submit" alt="{L_DL_DOWNLOAD}" title="{L_DL_DOWNLOAD}" value="1" />
			<input type="hidden" name="hotlink_id" value="{download_button.S_HOTLINK_ID}" />
			{download_button.S_HIDDEN_FIELDS}{S_HIDDEN_FIELDS}{S_FORM_TOKEN}
		</td>
	</tr>
	</table>

	<!-- IF S_ALLOW_TRAFFICFREE_DOWNLOAD --><p style="text-align: center"><span style="color: #FF0000;">{L_DL_CAN_DOWNLOAD_TRAFFIC}</span></p><!-- ENDIF -->

</form>
</div>
<!-- END download_button -->

Re: Mod Download OXPUS

Inviato: 04/06/2014, 2:32
da sakkiotto
OK.. ho fixato grazie al creatore della mod :D (ha risposto oggi era confessato) :D

Re: Mod Download OXPUS

Inviato: 16/08/2014, 18:37
da sakkiotto
mmm riprendo questo thread
è possibile far vedere i numeri dei download di un utente sul viewtopic e/o memberlist view oltre a vedersi nella topten dei utenti per download? visto che li se ne vedono soltanto 10 invece cosi nel forum uno puo verificare che chi scrive abbiamo scaricato qualcosa :D
downloads.php?view=stat