1 sayfadan 1. sayfa

Favori basliklar modu

İletiTarih: 11.05.2006, 11:33
murtaza
Description: Allows users the build a favorite topics list
Submited by: stefan
Creator: DanielT
Version: 1.0.3
Date: Fri 30 May, 2003 00:00
Last Updated: Fri 05 Sep, 2003 14:06
Last Download: Fri 05 May, 2006 10:49
File Size: 4.03 KB
Rating: 6.67 / 10 (6 Votes)
Downloaded: 783



Üyelerin istedigi basliklari favorilerine almasini sagliyor bu mod
Oldukca kulanisli
Sanirim daha öncede canver GÖRÜS ISTEK bölümünde böyle bir istek yapilmisti canver icin , ben bir alman phpbb sitesinde buldum hemen paylasayim dedim

Sevgiyle anacim

İletiTarih: 11.05.2006, 19:45
tankaya61
demosu olsaydı keşke :'(

İletiTarih: 11.05.2006, 19:53
murtaza
demosu yok
minnacik mod icinde demomu olurmus

Her basligin altina

BU BASLIGI TAKIP ET linkinin altina
Bu basligi favorilerime ekle linki veriyor

Bu basliklara forumun yukarisina koydugunuz
favorilerim linkiinden ulasabiliyorsunuz

Sevgiyle

İletiTarih: 11.05.2006, 19:56
tankaya61
tmm kızma :D
hee sanırım bıryerede gormustum bunu tmm tmm denıyorum

İletiTarih: 12.05.2006, 09:32
Pluton
favori başlıgına cevap geldiğinde özel mesaj atsa keşke :D

İletiTarih: 12.05.2006, 09:44
ALEXIS
pm ve mail göndermek zor bir şey değil :?

wgErics insert_pm function

Kod: Tümünü seç
// wgErics good old insert_pm function
function pa_insert_pm(
   $to_id,
   $message,
   $subject,
   $from_id,
   $html_on = 0,
   $bbcode_on = 1,
   $smilies_on = 1)
{
   global $db, $lang, $user_ip, $board_config, $userdata, $phpbb_root_path, $phpEx;

   if ( empty( $from_id ) )
   {
      $from_id = $userdata['user_id'];
   }

   //get varibles ready
   $to_id = intval($to_id);
   $from_id = intval($from_id);
   $msg_time = time();
   $attach_sig = $userdata['user_attachsig'];
   
   // Why send PM to yourself???
   if ( $to_id == $from_id )
   {
       return;
   }
   
   //get to users info
   $sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active
      FROM " . USERS_TABLE . "
      WHERE user_id = '$to_id'
         AND user_id <> " . ANONYMOUS;
   if ( !($result = $db->sql_query($sql)) )
   {
      $error = TRUE;
      $error_msg = $lang['No_such_user'];
   }

   $to_userdata = $db->sql_fetchrow($result);

   $privmsg_subject = trim(strip_tags($subject));
   if ( empty($privmsg_subject) )
   {
      $error = TRUE;
      $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_subject'];
   }

   if ( !empty($message) )
   {
      if ( !$error )
      {
         if ( $bbcode_on )
         {
            $bbcode_uid = make_bbcode_uid();
         }

         $privmsg_message = prepare_message($message, $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
         $privmsg_message = str_replace('\\\n', '\n', $privmsg_message);
      }
   }
   else
   {
      $error = TRUE;
      $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_message'];
   }

   //
   // See if recipient is at their inbox limit
   //
   $sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time
      FROM " . PRIVMSGS_TABLE . "
      WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . "
            OR privmsgs_type = " . PRIVMSGS_READ_MAIL . "
            OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )
         AND privmsgs_to_userid = " . $to_userdata['user_id'];
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_MESSAGE, $lang['No_such_user']);
   }

   $sql_priority = ( SQL_LAYER == 'mysql' ) ? 'LOW_PRIORITY' : '';

   if ( $inbox_info = $db->sql_fetchrow($result) )
   {
      if ( $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs'] )
      {
         $sql = "SELECT privmsgs_id FROM " . PRIVMSGS_TABLE . "
            WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . "
                  OR privmsgs_type = " . PRIVMSGS_READ_MAIL . "
                  OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . "  )
               AND privmsgs_date = " . $inbox_info['oldest_post_time'] . "
               AND privmsgs_to_userid = " . $to_userdata['user_id'];
         if ( !$result = $db->sql_query($sql) )
         {
            message_die(GENERAL_ERROR, 'Could not find oldest privmsgs (inbox)', '', __LINE__, __FILE__, $sql);
         }
         $old_privmsgs_id = $db->sql_fetchrow($result);
         $old_privmsgs_id = $old_privmsgs_id['privmsgs_id'];
           
         $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . "
            WHERE privmsgs_id = $old_privmsgs_id";
         if ( !$db->sql_query($sql) )
         {
            message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs (inbox)'.$sql, '', __LINE__, __FILE__, $sql);
         }

         $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TEXT_TABLE . "
            WHERE privmsgs_text_id = $old_privmsgs_id";
         if ( !$db->sql_query($sql) )
         {
            message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs text (inbox)', '', __LINE__, __FILE__, $sql);
         }
      }
   }

   $sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig)
      VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("\'", "''", $privmsg_subject) . "', " . $from_id . ", " . $to_userdata['user_id'] . ", $msg_time, '$user_ip', $html_on, $bbcode_on, $smilies_on, $attach_sig)";

   if ( !($result = $db->sql_query($sql_info, BEGIN_TRANSACTION)) )
   {
      message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info);
   }

   $privmsg_sent_id = $db->sql_nextid();

   $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)
      VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . str_replace("\'", "''", $privmsg_message) . "')";

   if ( !$db->sql_query($sql, END_TRANSACTION) )
   {
      message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql);
   }

   //
   // Add to the users new pm counter
   //
   $sql = "UPDATE " . USERS_TABLE . "
      SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . "
      WHERE user_id = " . $to_userdata['user_id'];
   if ( !$status = $db->sql_query($sql) )
   {
      message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);
   }

   if ( $to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active'] )
   {
      $script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path']));
      $script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx;
      $server_name = trim($board_config['server_name']);
      $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
      $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';

      include($phpbb_root_path . 'includes/emailer.'.$phpEx);
      $emailer = new emailer($board_config['smtp_delivery']);
               
      $emailer->from($board_config['board_email']);
      $emailer->replyto($board_config['board_email']);

      $emailer->use_template('privmsg_notify', $to_userdata['user_lang']);
      $emailer->email_address($to_userdata['user_email']);
      $emailer->set_subject($lang['Notification_subject']);
               
      $emailer->assign_vars(array(
         'USERNAME' => $to_username,
         'SITENAME' => $board_config['sitename'],
         'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '',

         'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox')
      );

      $emailer->send();
      $emailer->reset();
   }

   return;
   
   $msg = $lang['Message_sent'] . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . append_sid("privmsg.$phpEx?folder=inbox") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

   message_die(GENERAL_MESSAGE, $msg);

} // insert_pm()

İletiTarih: 12.05.2006, 09:46
Pluton
owww süper oldu tşk Alexıs

İletiTarih: 12.05.2006, 19:38
tankaya61
bu ne hız ALEXIS eyw.

İletiTarih: 12.05.2006, 20:45
murtaza
tesekkürler :)

Sevgiyle

İletiTarih: 12.05.2006, 21:01
ALEXIS
tamamda, verdiğim sadece örnek bir fonksiyon, kendize göre düzenlemelisiniz !

İletiTarih: 12.05.2006, 21:21
murtaza
düzeltiriz anacimsen kafani yorma :)

Sevgiyle

İletiTarih: 12.05.2006, 21:35
madozan
düzenlenmiş halini biri verse çok makbule geçer :$


edit:

bi önerm var yapılabilirmi ? bu ofurmun en ustune bi tablo olup orda seçtikleri 5 başlığı göstersek onar tıklasa yapılabilirmi ?

Cvp: Favori basliklar modu

İletiTarih: 14.05.2006, 10:36
tankaya61
bunu "Bu konuyu cevaplar için takip et" mantıgında yapabılırmıyız
yanı "fovorılere ekle" tıklayınca favorılere eklıyor.
eger daha once favorılere eklıyse ordakı yazı değişsin "favorılerden çıkart" yanı tıklayınca favorı lıstesınden sılınsın
boyle bısı yapmak webmasterlar ıcın zor olsama gerek :oops:

İletiTarih: 19.06.2006, 00:09
umit06umit
tesekkürler

İletiTarih: 23.06.2006, 21:31
dtdesigner
Favoriye ekle linki favorites.php ve favoriye eklemiyor. Sadece o sayfaya gidiyor. sql lerde tamam.