Smf 2.1 için Bookmarks ? (düzenleme)

Başlatan gevv, 02 Nis 2018 16:55

« önceki - sonraki »

0 Üyeler ve 1 Ziyaretçi konuyu incelemekte.

*

  1. 202

  2. 54

  3. 136

Selam,  bookmarks modunu  2.1 için düzenlemeye çalışıyorum kurulumda  "ManagePermissions.php"  dosyasında verdiği hataları giderdim fakat  "Display.template.php"  hatalarını çözemedim

konu butonlarınına  ekleme yapması lazım ama  2.1 sürümnde sistem baya değişmiş

bookmarks butonunu  konu sayfasında bulunan  ""yanıtla, yazdır vb."" buton grubuna nasıl ekleyebilirim


eski sürüm için modifikasyonun "Display.template.php"  dosyasında yaptığı değişiklik;

<file name="$themedir/Display.template.php">
<!-- Add a button for making bookmarks (num_replies, active reply button). Optional. -->
<operation error="ignore">
<search position="before"><![CDATA[
'reply' => array('test' => 'can_reply', 'text' => 'reply', 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies'], 'active' => true),]]></search>
<add><![CDATA[
'bookmark' => array('test' => 'can_make_bookmarks', 'text' => 'bookmark_add', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']),]]></add>
</operation>

<!-- Add a button for making bookmarks (last_msg, active reply button). Optional. -->
<operation error="ignore">
<search position="before"><![CDATA[
'reply' => array('test' => 'can_reply', 'text' => 'reply', 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';last_msg=' . $context['topic_last_message'], 'active' => true),]]></search>
<add><![CDATA[
'bookmark' => array('test' => 'can_make_bookmarks', 'text' => 'bookmark_add', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']),]]></add>
</operation>

<!-- Add a button for making bookmarks (num_replies, inactive reply button). Optional. -->
<operation error="ignore">
<search position="before"><![CDATA[
'reply' => array('test' => 'can_reply', 'text' => 'reply', 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']),]]></search>
<add><![CDATA[
'bookmark' => array('test' => 'can_make_bookmarks', 'text' => 'bookmark_add', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']),]]></add>
</operation>

<!-- Add a button for making bookmarks (last_msg, inactive reply button). Optional. -->
<operation error="ignore">
<search position="before"><![CDATA[
'reply' => array('test' => 'can_reply', 'text' => 'reply', 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';last_msg=' . $context['topic_last_message']),]]></search>
<add><![CDATA[
'bookmark' => array('test' => 'can_make_bookmarks', 'text' => 'bookmark_add', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']),]]></add>
</operation>

</file>


@snrj  hocamın paylaştığı Önemli Konular modu  fikir verir diyerek inceledim ama oda karmaşık kancalarla yapmış çözemedim

*

  1. 3,263

  2. 596

  3. 1077
modu kurup test etmedim ama
install.php ekle
// If we have found SSI.php and we are outside of SMF, then we are running standalone.
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
require_once(dirname(__FILE__) . '/SSI.php');
elseif (!defined('SMF')) // If we are outside SMF and can't find SSI.php, then throw an error
die('<b>Error:</b> Cannot install - please verify you put this file in the same place as SMF\'s SSI.php.');
if (SMF == 'SSI')
db_extend('packages');

// Define the hooks
$hook_functions = array(
'integrate_pre_include' => '$sourcedir/Bookmarks.php',
'integrate_display_buttons' => 'Bookmarks_menu',
);

// Adding or removing them?
if (!empty($context['uninstalling']))
$call = 'remove_integration_function';
else
$call = 'add_integration_function';

// Do the deed
foreach ($hook_functions as $hook => $function)
$call($hook, $function);
Bookmarks.php ekle
function Bookmarks_menu(&$buttons)
{
global $topicinfo, $context, $user_info, $scripturl;
$context['can_make_bookmarks'] = allowedTo('can_make_bookmarks');
if (empty($topicinfo['bookmark']))
$buttons['bookmark'] = array('test' => 'can_make_bookmarks', 'text' => 'bookmark_add', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic'] . ';' . $context['session_var'] . '=' . $context['session_id']);
}

bu şekilde eklemesi lazım butonu

*

  1. 202

  2. 54

  3. 136
Sağ olun @snrj  hocam lokalde sorun çıkmadı çalışıyor sunucuda deneyip sonucu bildiririm

*

  1. 202

  2. 54

  3. 136
03 Nis 2018 21:33 #3 Son düzenlenme: 19 Nis 2018 18:58 snrj

@snrj hocam  sunucuda test ettim sorun yok elinize sağlık

düzenlenen dosyaları ekliyorum

http://smf.konusal.com/index.php?action=downloads;sa=view;down=118

*

  1. 3,263

  2. 596

  3. 1077
download bölümüne ekleyin isterseniz gerekli izinleri verdim size hayırlı olsun

*

  1. 202

  2. 54

  3. 136
Selam,

@snrj   hocam  bu kadar zaman geçmesine rağmen yeni fark edilen bir sorun var izin verilmiş olmasına rağmen üyeler "favorilerime ekle" butonunu göremiyor sadece admine görünüyor

izinleri kontrol ettim ek olarak veri tabanında permissions tablosunada "make_bookmarks"  eklenmiş değerleri 1 olarak görünüyor

*

  1. 3,263

  2. 596

  3. 1077
Bookmarks.php de şu kodu
$context['can_make_bookmarks'] = allowedTo('can_make_bookmarks');şu şekilde bir değiştirelim
$context['can_make_bookmarks'] = allowedTo('make_bookmarks');

*

  1. 202

  2. 54

  3. 136
19 Nis 2018 10:40 #7 Son düzenlenme: 19 Nis 2018 18:58 snrj

Sağ olun @snrj  hocam  bende "allowedTo" "isallowedTo"  kodları ile kombinasyonlar deniyorum bir türlü olmamıştı  şuan çalışıyor.

Bu arada  ikonlar eski versiyona göre düzenlendiği için görünmüyordu onlarıda ekledim  gerekli düzenlemeleri yaptım.

Download sayfasında düzenleme yapılmadığı için dosyaları buraya ekliyorum

edit download bölümüne eklendi

http://smf.konusal.com/index.php?action=downloads;sa=view;down=118

*

  1. 3,263

  2. 596

  3. 1077
download bölümüne ekledim ve mesajlardaki ekleri kaldırdım

*

  1. 202

  2. 54

  3. 136
26 Ekm 2020 21:39 #9 Son düzenlenme: 26 Ekm 2020 21:51 gevv
Selam,

SMF 2.1 RC3 güncellemesi sonrasında konuyu favoriye eklemek istediğimde
Alıntı yapılan: undefinedWhen using the replace mode, the key column is a required entry.

hatası görünüyor konu favorilere eklenmiyor


eski sürümde kayıt edilen fori konular görünüyor sorun yok fakat rc3 sürümünde favori eklemesi yapılmıyor.

hata kaydında yazanlar;
Alıntı YapChange the method of db insert to insert or add the pk field to the key array
Function: addBookmark

sorun ne olabilir

iyi çalışmalar

*

  1. 202

  2. 54

  3. 136
Selam,

Sorun çözüldü resmi SMF sitesinde sağ olsun @Arantor  yardımcı oldu SMF 2.1 RC3 sürümünde kullanmak için Bookmarks.php  dosyasında

$result = $smcFunc['db_insert']('replace', '{db_prefix}bookmarks',
array(
'id_member' => 'int',
'id_topic' => 'int',
),
array(
'id_member' => $id_member,
'id_topic' => $id_topic,
),
array()
);

aşağıda ki ile değiştirlecek;

$result = $smcFunc['db_insert']('replace', '{db_prefix}bookmarks',
array(
'id_member' => 'int',
'id_topic' => 'int',
),
array(
'id_member' => $id_member,
'id_topic' => $id_topic,
),
array('id_member', 'id_topic')
);


Benzer Konular (5)


MENU ×