Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=117)
-   -   System Notice - Thanks (http://www.bvlist.com/showthread.php?t=6121)

lafouine022 3rd March 2011 03:48

System Notice - Thanks
 
edite takethanks.php

line 93
remplace
PHP Code:

mysql_query ('INSERT INTO ts_thanks VALUES (\'' $torrentid '\', \'' $userid '\')');
  if (
mysql_affected_rows ())
  { 

by

PHP Code:

mysql_query ('INSERT INTO ts_thanks VALUES (\'' $torrentid '\', \'' $userid '\')');
  if (
mysql_affected_rows ())
  {
    
$name1 = @mysql_fetch_array(@mysql_query('SELECT name FROM torrents WHERE id = \'' $torrentid '\''));
    
$name htmlspecialchars($name1['name']);
    
$name str_replace('.'' '$name);
    
$name str_replace('-'' '$name);
    
          
$seolink = ('' ''.$BASEURL.'/details.php?id=' sqlesc ($torrentid) . '&hit=1');
          
$shoutbOT sprintf ('' .$CURUSER['username']. ' said thank you for the torrent : [url='.$seolink.']' sqlesc ($name) . '[/url] .');
          
$shout_sql 'INSERT INTO shoutbox (userid, date, content) VALUES (\'999999999\', \'' TIMENOW '\', ' sqlesc ('{systemnotice}' $shoutbOT) . ')';
          
$shout_result sql_query ($shout_sql); 

enjoy :bubble:

Marco 3rd March 2011 09:30

Thank you
 
Very nice mod thank you working charm on my TS 5.6 Nightcrawler :)

Danix 3rd March 2011 14:56

Little edit for better performance
 
Little edit for better performance...
Line 92 replace
PHP Code:

mysql_query ('INSERT INTO ts_thanks VALUES (\'' $torrentid '\', \'' $userid '\')');
  if (
mysql_affected_rows ()) 

with this
PHP Code:

  mysql_query ('INSERT INTO ts_thanks VALUES (\'' $torrentid '\', \'' $userid '\')');
  if (
mysql_affected_rows ())
  {
  if ((
$tsshoutbot == 'yes' AND preg_match ('#thanks#'$tsshoutboxoptions)))
  {
    
$name1 = @mysql_fetch_array(@mysql_query('SELECT name FROM torrents WHERE id = \'' $torrentid '\''));
    
$name htmlspecialchars($name1['name']);
    
$name str_replace('.'' '$name);
    
$name str_replace('-'' '$name);
    
$anon $CURUSER['username'];
    
          
$seo_link ts_seo ($torrentid$name's');
          
$shoutbOT sprintf ($lang->global['shoutbOT'], $seo_link$name$anon);
          
$shout_sql 'INSERT INTO shoutbox (userid, date, content) VALUES (\'999999999\', \'' TIMENOW '\', ' sqlesc ('{systemnotice}' $shoutbOT) . ')';
          
$shout_result sql_query ($shout_sql);
    }
    include 
INC_PATH '/readconfig_kps.php';
    
kps ('+'$kpsthanks$userid);
    
show_thanks ();
    return 
1;
  } 

Open global.lang.php in folder /include/languages/English and paste this in bottom of page
PHP Code:

    'shoutbOT'                          =>'[color=#FF0000]{3}[/color] said thank you for the torrent [url={1}][color=#FFFF00]{2}[/color][/url] .'// Added by Danix 

before
PHP Code:

); 
?> 

Navigate to Tracker Settings=>EXTRA Settings and where fields Shoutbot Options add thanks after upload,newuser,request

Example: upload,newuser,request,thanks

That is...

Muikku 3rd March 2011 17:36

thanx nice mod. but if someone want upload anonym now if i thanks his torrent it was show relaser name in shoutbox.
How fix that ???

EMPEREUR1 4th March 2011 01:41

Quote:

Originally Posted by Danix (Post 27047)
Little edit for better performance...
Line 92 replace
PHP Code:

mysql_query ('INSERT INTO ts_thanks VALUES (\'' $torrentid '\', \'' $userid '\')');
  if (
mysql_affected_rows ()) 

with this
PHP Code:

  mysql_query ('INSERT INTO ts_thanks VALUES (\'' $torrentid '\', \'' $userid '\')');
  if (
mysql_affected_rows ())
  {
  if ((
$tsshoutbot == 'yes' AND preg_match ('#thanks#'$tsshoutboxoptions)))
  {
    
$name1 = @mysql_fetch_array(@mysql_query('SELECT name FROM torrents WHERE id = \'' $torrentid '\''));
    
$name htmlspecialchars($name1['name']);
    
$name str_replace('.'' '$name);
    
$name str_replace('-'' '$name);
    
$anon $CURUSER['username'];
    
          
$seo_link ts_seo ($torrentid$name's');
          
$shoutbOT sprintf ($lang->global['shoutbOT'], $seo_link$name$anon);
          
$shout_sql 'INSERT INTO shoutbox (userid, date, content) VALUES (\'999999999\', \'' TIMENOW '\', ' sqlesc ('{systemnotice}' $shoutbOT) . ')';
          
$shout_result sql_query ($shout_sql);
    }
    include 
INC_PATH '/readconfig_kps.php';
    
kps ('+'$kpsthanks$userid);
    
show_thanks ();
    return 
1;
  } 

Open global.lang.php in folder /include/languages/English and paste this in bottom of page
PHP Code:

    'shoutbOT'                          =>'[color=#FF0000]{3}[/color] said thank you for the torrent [url={1}][color=#FFFF00]{2}[/color][/url] .'// Added by Danix 

before
PHP Code:

); 
?> 

Navigate to Tracker Settings=>EXTRA Settings and where fields Shoutbot Options add thanks after upload,newuser,request

Example: upload,newuser,request,thanks

That is...


color usergroup possible ??????

lafouine022 4th March 2011 07:11

no work for me ^^


PHP Code:

  mysql_query ('INSERT INTO ts_thanks VALUES (\'' $torrentid '\', \'' $userid '\')');
  if (
mysql_affected_rows ())
  {
    
$name1 = @mysql_fetch_array(@mysql_query('SELECT name FROM torrents WHERE id = \'' $torrentid '\''));
    
$name htmlspecialchars($name1['name']);
    
$name str_replace('.'' '$name);
    
$name str_replace('-'' '$name);
    
$q sql_query("SELECT u.id, u.username, g.namestyle FROM users u LEFT JOIN usergroups g ON (u.usergroup=g.gid) WHERE u.id =" sqlesc ($userid));
    while(
$c=mysql_fetch_assoc($q))
    {
        
$color_n .= ''.get_user_color($c['username'], $c['namestyle']).'';
    }
          
$seolink = ('' ''.$BASEURL.'/details.php?id=' sqlesc ($torrentid) . '&hit=1');
          
$shoutbOT sprintf ('' .$color_n' dit merci pour le torrent : [url='.$seolink.']' sqlesc ($name) . '[/url] .·._.·´¯)');
          
$shout_sql 'INSERT INTO shoutbox (userid, date, content) VALUES (\'999999999\', \'' TIMENOW '\', ' sqlesc ('{systemnotice}' $shoutbOT) . ')';
          
$shout_result sql_query ($shout_sql); 

namestyle = {username} for me :p

no work in shoutbox

So use this methode :)



:muscle: Save your old version i'm not testing this code. Go sleeping sorry :p:p

PHP Code:

  mysql_query ('INSERT INTO ts_thanks VALUES (\'' $torrentid '\', \'' $userid '\')');
  if (
mysql_affected_rows ())
  {
  if ((
$tsshoutbot == 'yes' AND preg_match ('#thanks#'$tsshoutboxoptions)))
  {
    
$name1 = @mysql_fetch_array(@mysql_query('SELECT name FROM torrents WHERE id = \'' $torrentid '\''));
    
$name htmlspecialchars($name1['name']);
    
$name str_replace('.'' '$name);
    
$name str_replace('-'' '$name);
    
$anon $CURUSER['username'];
   
     
$resowner mysql_query("SELECT id, username, usergroup FROM users WHERE id=" sqlesc ($userid));
    
$arr2 htmlspecialchars_uni (mysql_fetch_array($resowner));
    if (
$arr2["usergroup"] == "13")
    
$arr1"[color=#999900]";
    if (
$arr2["usergroup"] == "11")
    
$arr1"[color=grey]";
    if (
$arr2["usergroup"] == "10")
    
$arr1"[color=darkgreen]";
    if (
$arr2["usergroup"] == "8")
    
$arr1"[color=darkred]";
    if (
$arr2["usergroup"] == "7")
    
$arr1"[color=#2587A7]";
    if (
$arr2["usergroup"] == "6")
    
$arr1"[color=#B000B0]";
    if (
$arr2["usergroup"] == "5")
    
$arr1"[color=#ff5151]";
    if (
$arr2["usergroup"] == "4")
    
$arr1"[color=navy]";
    if (
$arr2["usergroup"] == "3")
    
$arr1"[color=#66CC00]";
    if (
$arr2["usergroup"] == "2")
    
$arr1"[color=#0099FF]";
    if (
$arr2["usergroup"] == "1")
    
$arr1"[color=black]";
    
          
$seo_link ts_seo ($torrentid$name's');
          
$shoutbOT sprintf ($lang->global['shoutbOT'], $seo_link$name$anon$arr1);
          
$shout_sql 'INSERT INTO shoutbox (userid, date, content) VALUES (\'999999999\', \'' TIMENOW '\', ' sqlesc ('{systemnotice}' $shoutbOT) . ')';
          
$shout_result sql_query ($shout_sql);
    }
    include 
INC_PATH '/readconfig_kps.php';
    
kps ('+'$kpsthanks$userid);
    
show_thanks ();
    return 
1;
  } 



and in global.lang.php in folder /include/languages/English

PHP Code:

'shoutbOT'                          =>'{4}{3} said thank you for the torrent {2} .'



THIS WORK ???

Omenke 4th March 2011 12:56

RE
 
I thank you for it works perfectly.








lafouine022 4th March 2011 14:16

:ok:

Darkness 8th December 2011 14:13

Hello!!
 
It`s work ...but appear only the name of the boot and nothing else ....how I can fix that ?
And I make both types

SpEnSeR 11th December 2011 14:47

nice one it works.. :) :drink:


All times are GMT +2. The time now is 12:36.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.