Tarih: 29 Ağustos 2003, 02:05 Mesaj konusu: Hide tagı hakkında
merhabalar [hide][/hide] tagı hakkında bir sorum olacaktı ben bunu phpbbport 2.0.6 ya uygulamaya çalıştım herşey normal oldu ama gizli mesaj yazdıktan sonra birisi cevap verince açılması gerekirken yazılan mesaj hep gizli kalıyordu yaabncı siteden almıştım yapılışı ingilizcem iyi değil ama nerde hata yaptığımı bulamamıştım sonra bbcode_box modunu ekledim foruma çok güzel oldu ama ben yine bu hide tagını eklemek istiyorum bunu bbcode_box içine nasıl uygulayabilirim bu kodun yapılışını anlatabilirseniz çok memnun olurum ingilizce linkleri var ama benim ingilizcem zayıf bu konuda bilgilerinizi paylaşırsanız sevinirim...
Kayıt: 23 Haziran 2003
Mesajlar: 2563
Nerden: Geriden
Tarih: 30 Ağustos 2003, 00:24 Mesaj konusu:
Öncelikle bu mod phpBB 2.0.3, 2.0.4, 2.0.5, 2.0.6 sürümlerde çalışır.Sürümün farklıysa yapamazsın.Hide modunu eğer bu aşağıda yazdıklarıma bakmadan önce yüklediysen Hide tagı ile ilgili tüm dosyaları eski haline getirip daha sonra sıfırdan bu anlattıklarımı yapmanı öneririm..
Bu bölümü bul:
codeDivStart()
if ( !preg_match('/^Re:/', $subject) && strlen($subject) > 0 )
{
$subject = 'Re: ' . $subject;
}
Altına bunu ekle:
codeDivStart()
if( !$userdata['session_logged_in'] ) {$message = hide_in_quote($message);}
else { $sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
if(!$db->sql_numrows($resultat)) {$message = hide_in_quote($message);}
}
viewtopic.php dosyasını aç,
Bu bölümü bul:
codeDivStart()
//
// Generate a 'Show posts in previous x days' select box. If the postdays var is POSTed
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
//
Altına bunu ekle:
codeDivStart()
$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}
Bu bölümü bul:
codeDivStart()
if ( $user_sig != '' && $user_sig_bbcode_uid != '' )
{
$user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $user_sig);
}
search.php dosyasını aç,
Bu bölümü bul:
codeDivStart()
//
// If the board has HTML off but the post has HTML
// on then we process it, else leave it alone
//
if ( $return_chars != -1 )
Bununla değiştir:
codeDivStart()
//
// If the board has HTML off but the post has HTML
// on then we process it, else leave it alone
//
if( $return_chars == -1 )
Bu bölümü bul:
codeDivStart()
if ( $bbcode_uid != '' )
{
$message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
}
includes klasöründeki topic_review.php dosyasını aç,
Bu bölümü bul:
codeDivStart()
//
// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...
//
if ( $row = $db->sql_fetchrow($result) )
{
Altına bunu ekle:
codeDivStart()
$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}
Bu bölümü bul:
codeDivStart()
if ( $bbcode_uid != "" )
{
$message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
}
includes klasöründeki bbcode.php dosyasını aç,
Bu bölümü bul:
codeDivStart()
$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);
Altına bunu ekle:
codeDivStart()
$bbcode_tpl['show'] = str_replace('{HTEXTE}', '\\1', $bbcode_tpl['show']);
Bu bölümü bul:
codeDivStart()
/**
* Does second-pass bbencoding. This should be used before displaying the message in
* a thread. Assumes the message is already first-pass encoded, and we are given the
* correct UID as used in first-pass encoding.
*/
Hemen önce bu bölümü ekle:
codeDivStart()
function hide_in_quote($text)
{
$text = preg_replace("#\[hide\](.*?)\[\/hide\]#si","--- phpBB : The Protected Message is not copied in this quote ---", $text);
return $text;
}
function bbencode_third_pass($text, $uid, $deprotect)
{
global $bbcode_tpl;
// pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).
// This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
$text = " " . $text;
// First: If there isn't a "[" and a "]" in the message, don't bother.
if (! (strpos($text, "[") && strpos($text, "]")) )
{
// Remove padding, return.
$text = substr($text, 1);
return $text;
}
// Patterns and replacements for URL and email tags..
$patterns = array();
$replacements = array();
// Remove our padding from the string..
$text = substr($text, 1);
return $text;
}
Bu bölümü bul:
codeDivStart()
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\](([a-z]+?)://([^ \"\n\r]+?))\[/img\]#si", "[img:$uid]\\1[/img:$uid]", $text);
Altına bunu ekle:
codeDivStart()
//[hide]message[/hide]
$text = preg_replace("#\[hide\](.*?)\[\/hide\]#si","[hide:$uid]\\1[/hide:$uid]", $text);
templates klasörü içinde subSilver veya hangi templateyi kullanıyorsan o klasörün içinde bbcode.tpl dosyasını aç,
Dosyanın en üst bölümüne (yani en yukarıya yazılcak) direk bunu ekle:
codeDivStart()
<!-- BEGIN show -->
</span>
<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1">
<tr>
<td><span class="genmed"><b>Protected Message:</b></span></td>
</tr>
<tr>
<td class="quote">
{HTEXTE}
</td>
</tr>
</table>
<span class="postbody">
<!-- END show -->
<!-- BEGIN hide -->
</span>
<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1">
<tr>
<td><span class="genmed"><b>Korumalı Mesaj:</b></span></td>
</tr>
<tr>
<td class="quote">
<center>--- Eğer kayıtlı kullanıcı iseniz bu mesajı görebilmeniz için herhangi bir mesaj yazmanız gerekmektedir ---</center>
</td>
</tr>
</table>
<span class="postbody">
<!-- END hide -->
templates klasörü içinde subSilver veya hangi templateyi kullanıyorsan o klasörün içinde posting_body.tpl dosyasını aç,
Bu bölümü bul:
codeDivStart()
// Helpline messages
Altına bunu ekle:
codeDivStart()
h_help = "Hide: [hide]message[/hide] (alt+h)";
Bu bölümü bul:
codeDivStart()
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
Bununla değiştir:
codeDivStart()
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[hide]','[/hide]');
( Not: Başka bbcode tagı eklediysen '[url]','[/url]', kısmından sonra '[hide]','[/hide]' kısmını ekle. )
Bu bölümü bul:
codeDivStart()
<td><span class="genmed">
<input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
</span></td>
Altına bunu ekle:
codeDivStart()
<td><span class="genmed">
<input type="button" class="button" accesskey="h" name="addbbcode18" value="Hide" style="width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('h')" />
</span></td>
( Not: Bu kısımda ise "addbbcode16" bölümünü dikkate almalısın.Her bbcode tagi eklendiğinde "16" sayısı 2 sayı artar hide tagında aynı şekilde 2 sayı arttı.Eğer başka bir bbcode tagleri eklediysen addbbcode16,addbbcode18,addbbcode20,addbbcode22 şeklinde devam etmesini sağlamalısın. )
Fakat ben şuan bbcode box modunu kullanıyorum bu dediklerinizi ona ilave edebilirmiyim yada onun yanına harici olarak nasıl eklerim bir farklılık olurmu acaba çünkü dosyalar bbcode_box agöre olduğu için editlenmiş durumdalar orginal değiller bbcode box modunun içine bunları ilave etme sansım varmı bu konudaki fikriniz nedir yukarıdaki geniş anlatımının için çok teşekkür ederim elinize sağlık..
Dostum açıklaman için teşekkürderim yordum seni biraz şimdi yukarıdaki verdiklerini aynen ekliyorum sonra bbcode box a eklemek için şimdi verdiklerinide ekliyorum tamam ama en önemli sorun şu bbcode box mod kurulu olduğu için
posting_body.tpl ve posting_body.tpl
dosyalarında ki yerleri bul ve değiştir dediğin yerler yok şuan peki bu yüzden posting_body.tpl ve posting_body.tpl dosyalarına ekleyemediğim bu kod ları nereye ve nasıl ekleyeceğim...
Çok soru sorduğum için kusura bakma ama bunu kurmak çok önemli benim için ilgi ve alakan için çok teşekkürler...
Dostum bu arada dediğin dosyaları aynen orginalleri ile değiştirip bütün verdiğin code leri aynen yerleştirdim hiç hata yok ama sana ilk bu konuyu yazdığım gibi korunmalı hide mesajı kullanıp bir konu açtığım zaman başka kullanıcılar konuya cevap yazdığında açılması gerekirken korumalı mesaj açılmamakta bu neden oluyor anlamıyorum dediklerini aynen yazptım o siteden aldığımdada böyle bir sorun vardı ama adamların sitede code çalışmakta ama bende eminimki denilenleri yanlışsız uyguluyorum bende ingilizcem dediğim gibi iyi olmadığı için bunu aldığımız adamın sitesine sorunu yazamadım ve kimsede bu konuda hakkında birşey bilmiyor bunu nasıl halledicem bilemiyorum...
Dostum şu an sizin sitede bbcode box göremedim ben ama sorun buda değil dediğim gibi mesaja vcevap verince korumalı mesaj açılmıyor ve hiç hatasız dediklerini uyguladım orginal dosyalar esas sorun bu bu konuda bir fikrin varmı acaba