lostyazilim
tr.link

Html icinde php

17 Mesajlar 2.439 Okunma
lstbozum
tr.link

MuhammedArslan MuhammedArslan Msa Web Tasarım Kullanıcı
  • Üyelik 19.02.2017
  • Yaş/Cinsiyet 24 / E
  • Meslek Web Developer
  • Konum Bursa
  • Ad Soyad M** A**
  • Mesajlar 933
  • Beğeniler 136 / 276
  • Ticaret 11, (%100)
Tekrardan merhabalar,
Html icinde php kullanirken surekli tag acip kapatmak yerine kullanilabilecek bir yontem var midir?

Ornegin laravel'de {{$veri}} olarak yazdiginizda olarak algiliyor. Bunun gibi bir sistem kurulabilir mi?
 

 

wmaraci
reklam

bera65 bera65 WM Aracı Kullanıcı
  • Üyelik 04.10.2014
  • Yaş/Cinsiyet 39 / E
  • Meslek Web Tasarımcısı
  • Konum Van
  • Ad Soyad B** R**
  • Mesajlar 118
  • Beğeniler 47 / 47
  • Ticaret 2, (%100)
html içinde değilde php içinde html kullan ve

smarty yi kullanmanı öneririm
 

 

Presta Centre

MuhammedArslan MuhammedArslan Msa Web Tasarım Kullanıcı
  • Üyelik 19.02.2017
  • Yaş/Cinsiyet 24 / E
  • Meslek Web Developer
  • Konum Bursa
  • Ad Soyad M** A**
  • Mesajlar 933
  • Beğeniler 136 / 276
  • Ticaret 11, (%100)

bera65 adlı üyeden alıntı

html içinde değilde php içinde html kullan ve

smarty yi kullanmanı öneririm


smarty 'yi inceledim. Kullanıcı basit gibi geldi. Çok fazla ayrıntı yok. Peki bunu kullanmanın avantajı nedir? yani tek avantajı tag açıp kapatmaktan mı kurtarması?
 

 

bera65 bera65 WM Aracı Kullanıcı
  • Üyelik 04.10.2014
  • Yaş/Cinsiyet 39 / E
  • Meslek Web Tasarımcısı
  • Konum Van
  • Ad Soyad B** R**
  • Mesajlar 118
  • Beğeniler 47 / 47
  • Ticaret 2, (%100)
avantajı şu html kodu içinde php kodunu kullanmak

mesela

{$kullaniciAdi}


normalde ise şu

 

 

Presta Centre
wmaraci
wmaraci

HerAlanda HerAlanda ZeHiRLy Kullanıcı
  • Üyelik 23.11.2014
  • Yaş/Cinsiyet 38 / E
  • Meslek Web Öğreniyor...
  • Konum Gaziantep
  • Ad Soyad M** K**
  • Mesajlar 67
  • Beğeniler 2 / 16
  • Ticaret 0, (%0)
Veya :P
berkangndz JumperTech

kişi bu mesajı beğendi.

MuhammedArslan MuhammedArslan Msa Web Tasarım Kullanıcı
  • Üyelik 19.02.2017
  • Yaş/Cinsiyet 24 / E
  • Meslek Web Developer
  • Konum Bursa
  • Ad Soyad M** A**
  • Mesajlar 933
  • Beğeniler 136 / 276
  • Ticaret 11, (%100)

bera65 adlı üyeden alıntı

avantajı şu html kodu içinde php kodunu kullanmak

mesela

{$kullaniciAdi}


normalde ise şu


Farkli uzantilar falan beni hic acmadi .d zaten bir suru fonksiyon kullaniyorum bu kadar karistirmaya gerek yok. Yinede tesekkurler.


Sonumuz o olacak heralde hocam :)
 

 

dump3cz dump3cz Üyeliği Durdurulmuş Banlı Kullanıcı
  • Üyelik 01.05.2017
  • Yaş/Cinsiyet 25 / E
  • Meslek Yazılım
  • Konum Bilecik
  • Ad Soyad O** Ç**
  • Mesajlar 1749
  • Beğeniler 169 / 326
  • Ticaret 3, (%67)
mrarslan Hocam dediğim gibi :D mybb :D :D ama şu veri çekmeyi yapamadım :(
 

 

MuhammedArslan MuhammedArslan Msa Web Tasarım Kullanıcı
  • Üyelik 19.02.2017
  • Yaş/Cinsiyet 24 / E
  • Meslek Web Developer
  • Konum Bursa
  • Ad Soyad M** A**
  • Mesajlar 933
  • Beğeniler 136 / 276
  • Ticaret 11, (%100)

dump3cz adlı üyeden alıntı

mrarslan Hocam dediğim gibi :D mybb :D :D ama şu veri çekmeyi yapamadım :(

Nerede takildin hocam? arkadan attigi linkte gayet guzel anlatiyordu, mantigi guzel aslinda. Ben projeme dahil ettim bakalim :)
 

 

dump3cz dump3cz Üyeliği Durdurulmuş Banlı Kullanıcı
  • Üyelik 01.05.2017
  • Yaş/Cinsiyet 25 / E
  • Meslek Yazılım
  • Konum Bilecik
  • Ad Soyad O** Ç**
  • Mesajlar 1749
  • Beğeniler 169 / 326
  • Ticaret 3, (%67)
mrarslan Hocam Şöyle bir eklenti mevcut mybb'de aşağı atıyorum inceleyip yaparsın:

/*
* The MIT License
*
* Copyright 2016 Arthur.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

if(!defined("IN_MYBB")) {
exit;
}

$plugins->hooks['pre_output_page'][5]['LightAvatars->getAvatars']=[
'class_method' => ['LightAvatars', 'getAvatars']
];

function lightavatars_info() {
global $lang, $db;
$lang->load('config_lightavatars');

$query = $db->simple_select('settinggroups', 'gid', "name='lightavatars'");
$gid = $db->fetch_field($query, 'gid');
if($gid) {
$linktodesc=$lang->lightavatars_desc.'
'.$lang->lightavatars_shortcut.'';
} else {
$linktodesc=$lang->lightavatars_desc;
}

return [
"name" => "LightAVATARS",
"description" => $linktodesc,
"website" => "",
"author" => "KICek",
"authorsite" => "",
"version" => "0.9.9",
"codename" => "LastPosterAvatarLight",
"compatibility" => "18*"
];
}

function lightavatars_is_installed() {
global $db;
return $db->num_rows(
$db->simple_select(
'settinggroups',
'*',
'name="lightavatars"'
)
);
}

function lightavatars_activate() {
global $db, $cache, $lang, $mybb;
$lang->load('config_lightavatars');

$sgid=$db->insert_query(
"settinggroups",
[
"name"=>"lightavatars",
"title"=>"LightAVATARS",
"description"=>$db->escape_string($lang->lightavatars_desc)
]);

$avatarview='
<script>settings['bburl'].'/resources/settings.js"></script>';

$sg=[
[
'name'=>'lightavatars_view',
'title'=>$lang->lightavatars_view,
'description'=>$avatarview,
'optionscode'=>'select \n 1=setting_lightavatars_forumbit_depth2_forum_lastpost \n 2=setting_lightavatars_forumbit_depth1_forum_lastpost \n 3=setting_lightavatars_forumdisplay_thread_firstpost \n 4=setting_lightavatars_forumdisplay_thread_lastpost \n 5=setting_lightavatars_search_results_posts_post \n 6=setting_lightavatars_search_results_threads_thread_firstpost \n 7=setting_lightavatars_search_results_threads_thread_lastpost \n 8=setting_lightavatars_private_messagebit \n 9=setting_lightavatars_forumdisplay_announcements_announcement \n',
'value'=>'1'
],
[
'name'=>'lightavatars_custom',
'title'=>$lang->lightavatars_custom,
'description'=>$lang->lightavatars_custom_desc,
'optionscode'=>'yesno',
'value'=>'0'
],
[
'name'=>'lightavatars_forumbit_depth2_forum_lastpost',
'title'=>$lang->lightavatars_forumbit_depth2_forum_lastpost,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-n'
],
[
'name'=>'lightavatars_forumbit_depth1_forum_lastpost',
'title'=>$lang->lightavatars_forumbit_depth1_forum_lastpost,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-n'
],
[
'name'=>'lightavatars_forumdisplay_thread_firstpost',
'title'=>$lang->lightavatars_forumdisplay_thread_firstpost,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-f'
],
[
'name'=>'lightavatars_forumdisplay_thread_lastpost',
'title'=>$lang->lightavatars_forumdisplay_thread_lastpost,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-f'
],
[
'name'=>'lightavatars_search_results_posts_post',
'title'=>$lang->lightavatars_search_results_posts_post,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-m'
],
[
'name'=>'lightavatars_search_results_threads_thread_firstpost',
'title'=>$lang->lightavatars_search_results_threads_thread_firstpost,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-n'
],
[
'name'=>'lightavatars_search_results_threads_thread_lastpost',
'title'=>$lang->lightavatars_search_results_threads_thread_lastpost,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-n'
],
[
'name'=>'lightavatars_private_messagebit',
'title'=>$lang->lightavatars_private_messagebit,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-m'
],
[
'name'=>'lightavatars_forumdisplay_announcements_announcement',
'title'=>$lang->lightavatars_forumdisplay_announcements_announcement,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-f'
]
];

$i=1;
foreach ($sg as &$row) {
$row['gid']=$sgid;
$row['title']=$db->escape_string($row['title']);
$row['description']=$db->escape_string($row['description']);
$row['disporder']=$i++;

}

$db->insert_query_multiple('settings', $sg);
rebuild_settings();

$db->delete_query(
'themestylesheets',
'name="lightavatars.css" AND tid=1'
);
$styles=file_get_contents(__DIR__.'/../../resources/lightavatars.css');

$db->insert_query(
"themestylesheets",
[
"name"=>"lightavatars.css",
"cachefile"=>"lightavatars.css",
"tid"=>"1",
"attachedto"=>"",
"stylesheet"=>$db->escape_string($styles),
"lastmodified"=>TIME_NOW
]
);

require_once MYBB_ADMIN_DIR."inc/functions_themes.php";
cache_stylesheet(1,"lightavatars.css",$styles);
update_theme_stylesheet_list(1);

require_once MYBB_ROOT.'inc/adminfunctions_templates.php';
find_replace_templatesets(
'forumdisplay_thread',
'#'.preg_quote('{$attachment_count}').'#',
'{+}forumdisplay_thread_firstpost|{$thread[\'uid\']}{-}{$attachment_count}'
);

find_replace_templatesets(
'forumdisplay_thread',
'/<(.*?)(\s*?){\$lastpostdate}/',
'{+}forumdisplay_thread_lastpost|{$thread[\'lastposteruid\']}{-}<\\1\\2{$lastpostdate}'
);

find_replace_templatesets(
'forumbit_depth1_forum_lastpost',
'#\A#',
'{+}forumbit_depth1_forum_lastpost|{$lastpost_data[\'lastposteruid\']}{-}'
);

find_replace_templatesets(
'forumbit_depth2_forum_lastpost',
'#\A#',
'{+}forumbit_depth2_forum_lastpost|{$lastpost_data[\'lastposteruid\']}{-}'
);

find_replace_templatesets(
'search_results_posts_post',
'#'.preg_quote('{$post[\'profilelink\']}').'#',
'{+}search_results_posts_post|{$post[\'uid\']}{-}{$post[\'profilelink\']}'
);

find_replace_templatesets(
'search_results_threads_thread',
'#'.preg_quote('{$attachment_count}').'#',
'{+}search_results_threads_thread_firstpost|{$thread[\'uid\']}{-}{$attachment_count}'
);

find_replace_templatesets(
'search_results_threads_thread',
'/<(.*?)(\s*?){\$lastpostdate}/',
'{+}forumdisplay_thread_lastpost|{$thread[\'lastposteruid\']}{-}<\\1\\2{$lastpostdate}'
);
find_replace_templatesets(
'private_messagebit',
'#'.preg_quote('{$tofromusername}').'#',
'{+}private_messagebit|{$tofromuid}{-}{$tofromusername}'
);
find_replace_templatesets(
'forumdisplay_announcements_announcement',
'#<(.*?)'.preg_quote('{$announcement[\'subject\']}').'#',
'{+}forumdisplay_announcements_announcement|{$announcement[\'fid\']}{-}<\\1{$announcement[\'subject\']}'
);
}

function lightavatars_deactivate() {
global $db, $cache;
$db->delete_query(
'themestylesheets',
'name="lightavatars.css" AND tid=1'
);

require_once MYBB_ADMIN_DIR."inc/functions_themes.php";
@unlink(MYBB_ROOT."cache/themes/theme1/lightavatars.css");
@unlink(MYBB_ROOT."cache/themes/theme1/lightavatars.min.css");
update_theme_stylesheet_list(1);

$db->delete_query("settinggroups", "name=\"lightavatars\"");
$db->delete_query("settings", "name LIKE \"lightavatars%\"");
rebuild_settings();

require_once MYBB_ROOT.'inc/adminfunctions_templates.php';
$deletepattern='#\{\+\}(.*?)\{-\}#';
find_replace_templatesets(
'forumdisplay_thread',
$deletepattern,
''
);
find_replace_templatesets(
'forumbit_depth1_forum_lastpost',
$deletepattern,
''
);
find_replace_templatesets(
'forumbit_depth2_forum_lastpost',
$deletepattern,
''
);
find_replace_templatesets(
'search_results_posts_post',
$deletepattern,
''
);
find_replace_templatesets(
'search_results_threads_thread',
$deletepattern,
''
);
find_replace_templatesets(
'private_messagebit',
$deletepattern,
''
);
find_replace_templatesets(
'forumdisplay_announcements_announcement',
$deletepattern,
''
);
}

class LightAvatars
{

public function getAvatars(&$content)
{
global $db, $mybb;

//input
preg_match_all('/\{\+\}(.*?)\|(.*?)\{\-\}/', $content, $matches);
if(!$matches[0]) {
return $content;
}

//getinfo
$matchescount=count($matches[0]);

while($matchescount--) {

$info[$matches[2][$matchescount]]['position'][$matches[1][$matchescount]]=1;
if($matches[2][$matchescount]!=0) {
$select[$matches[2][$matchescount]]=$matches[2][$matchescount];
} else {
$info[0]['avatar']='./'.$mybb->settings['useravatar'];
$info[0]['name']='unregistered';
}
}

//getdatafromdb
if(isset($select)) {
$selected='uid='.implode(' OR uid=',$select);
$avatardata=$db->simple_select(
'users',
'uid,username,avatar',
$selected,
NULL
);
while($base=$db->fetch_array($avatardata)) {
$info[$base['uid']]['avatar']=$base['avatar'];
$info[$base['uid']]['name']=$base['username'];
}
}

//setavatars
foreach($info as $key => $avatar) {

if(empty($avatar['avatar'])) {
$avatar['avatar']='./'.$mybb->settings['useravatar'];
}

if($key!==0) {
$avatargen=''.$mybb->settings['bbname'].'settings['bburl'].'/'.$mybb->settings['useravatar'].'\';">';
} else {
$avatargen=''.$mybb->settings['bbname'].'settings['bburl'].'/'.$mybb->settings['useravatar'].'\';">';
}

foreach($avatar['position'] as $position => $truevalue) {
if(!$masterstyle[$position]) {
$masterstyle[$position]=explode(' ',$mybb->settings['lightavatars_'.$position]);
$masterstyle[$position]="lavatar-".implode(" lavatar-",$masterstyle[$position]);
}
if($mybb->settings['lightavatars_custom']) {
$style['avatar']=' lavatar-'.$avatar['name'].'-'.$position;
}
$content=str_replace('{+}'.$position.'|'.$key.'{-}', '
'.$avatargen.'
', $content);
}
}
return $content;
}
}
 

 

MuhammedArslan MuhammedArslan Msa Web Tasarım Kullanıcı
  • Üyelik 19.02.2017
  • Yaş/Cinsiyet 24 / E
  • Meslek Web Developer
  • Konum Bursa
  • Ad Soyad M** A**
  • Mesajlar 933
  • Beğeniler 136 / 276
  • Ticaret 11, (%100)

dump3cz adlı üyeden alıntı

mrarslan Hocam Şöyle bir eklenti mevcut mybb'de aşağı atıyorum inceleyip yaparsın:

/*
* The MIT License
*
* Copyright 2016 Arthur.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

if(!defined("IN_MYBB")) {
exit;
}

$plugins->hooks['pre_output_page'][5]['LightAvatars->getAvatars']=[
'class_method' => ['LightAvatars', 'getAvatars']
];

function lightavatars_info() {
global $lang, $db;
$lang->load('config_lightavatars');

$query = $db->simple_select('settinggroups', 'gid', "name='lightavatars'");
$gid = $db->fetch_field($query, 'gid');
if($gid) {
$linktodesc=$lang->lightavatars_desc.'
'.$lang->lightavatars_shortcut.'';
} else {
$linktodesc=$lang->lightavatars_desc;
}

return [
"name" => "LightAVATARS",
"description" => $linktodesc,
"website" => "",
"author" => "KICek",
"authorsite" => "",
"version" => "0.9.9",
"codename" => "LastPosterAvatarLight",
"compatibility" => "18*"
];
}

function lightavatars_is_installed() {
global $db;
return $db->num_rows(
$db->simple_select(
'settinggroups',
'*',
'name="lightavatars"'
)
);
}

function lightavatars_activate() {
global $db, $cache, $lang, $mybb;
$lang->load('config_lightavatars');

$sgid=$db->insert_query(
"settinggroups",
[
"name"=>"lightavatars",
"title"=>"LightAVATARS",
"description"=>$db->escape_string($lang->lightavatars_desc)
]);

$avatarview='
<script>settings['bburl'].'/resources/settings.js"></script>';

$sg=[
[
'name'=>'lightavatars_view',
'title'=>$lang->lightavatars_view,
'description'=>$avatarview,
'optionscode'=>'select \n 1=setting_lightavatars_forumbit_depth2_forum_lastpost \n 2=setting_lightavatars_forumbit_depth1_forum_lastpost \n 3=setting_lightavatars_forumdisplay_thread_firstpost \n 4=setting_lightavatars_forumdisplay_thread_lastpost \n 5=setting_lightavatars_search_results_posts_post \n 6=setting_lightavatars_search_results_threads_thread_firstpost \n 7=setting_lightavatars_search_results_threads_thread_lastpost \n 8=setting_lightavatars_private_messagebit \n 9=setting_lightavatars_forumdisplay_announcements_announcement \n',
'value'=>'1'
],
[
'name'=>'lightavatars_custom',
'title'=>$lang->lightavatars_custom,
'description'=>$lang->lightavatars_custom_desc,
'optionscode'=>'yesno',
'value'=>'0'
],
[
'name'=>'lightavatars_forumbit_depth2_forum_lastpost',
'title'=>$lang->lightavatars_forumbit_depth2_forum_lastpost,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-n'
],
[
'name'=>'lightavatars_forumbit_depth1_forum_lastpost',
'title'=>$lang->lightavatars_forumbit_depth1_forum_lastpost,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-n'
],
[
'name'=>'lightavatars_forumdisplay_thread_firstpost',
'title'=>$lang->lightavatars_forumdisplay_thread_firstpost,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-f'
],
[
'name'=>'lightavatars_forumdisplay_thread_lastpost',
'title'=>$lang->lightavatars_forumdisplay_thread_lastpost,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-f'
],
[
'name'=>'lightavatars_search_results_posts_post',
'title'=>$lang->lightavatars_search_results_posts_post,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-m'
],
[
'name'=>'lightavatars_search_results_threads_thread_firstpost',
'title'=>$lang->lightavatars_search_results_threads_thread_firstpost,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-n'
],
[
'name'=>'lightavatars_search_results_threads_thread_lastpost',
'title'=>$lang->lightavatars_search_results_threads_thread_lastpost,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-n'
],
[
'name'=>'lightavatars_private_messagebit',
'title'=>$lang->lightavatars_private_messagebit,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-m'
],
[
'name'=>'lightavatars_forumdisplay_announcements_announcement',
'title'=>$lang->lightavatars_forumdisplay_announcements_announcement,
'description'=>"",
'optionscode'=>'text',
'value'=>'old old-f'
]
];

$i=1;
foreach ($sg as &$row) {
$row['gid']=$sgid;
$row['title']=$db->escape_string($row['title']);
$row['description']=$db->escape_string($row['description']);
$row['disporder']=$i++;

}

$db->insert_query_multiple('settings', $sg);
rebuild_settings();

$db->delete_query(
'themestylesheets',
'name="lightavatars.css" AND tid=1'
);
$styles=file_get_contents(__DIR__.'/../../resources/lightavatars.css');

$db->insert_query(
"themestylesheets",
[
"name"=>"lightavatars.css",
"cachefile"=>"lightavatars.css",
"tid"=>"1",
"attachedto"=>"",
"stylesheet"=>$db->escape_string($styles),
"lastmodified"=>TIME_NOW
]
);

require_once MYBB_ADMIN_DIR."inc/functions_themes.php";
cache_stylesheet(1,"lightavatars.css",$styles);
update_theme_stylesheet_list(1);

require_once MYBB_ROOT.'inc/adminfunctions_templates.php';
find_replace_templatesets(
'forumdisplay_thread',
'#'.preg_quote('{$attachment_count}').'#',
'{+}forumdisplay_thread_firstpost|{$thread[\'uid\']}{-}{$attachment_count}'
);

find_replace_templatesets(
'forumdisplay_thread',
'/<(.*?)(\s*?){\$lastpostdate}/',
'{+}forumdisplay_thread_lastpost|{$thread[\'lastposteruid\']}{-}<\\1\\2{$lastpostdate}'
);

find_replace_templatesets(
'forumbit_depth1_forum_lastpost',
'#\A#',
'{+}forumbit_depth1_forum_lastpost|{$lastpost_data[\'lastposteruid\']}{-}'
);

find_replace_templatesets(
'forumbit_depth2_forum_lastpost',
'#\A#',
'{+}forumbit_depth2_forum_lastpost|{$lastpost_data[\'lastposteruid\']}{-}'
);

find_replace_templatesets(
'search_results_posts_post',
'#'.preg_quote('{$post[\'profilelink\']}').'#',
'{+}search_results_posts_post|{$post[\'uid\']}{-}{$post[\'profilelink\']}'
);

find_replace_templatesets(
'search_results_threads_thread',
'#'.preg_quote('{$attachment_count}').'#',
'{+}search_results_threads_thread_firstpost|{$thread[\'uid\']}{-}{$attachment_count}'
);

find_replace_templatesets(
'search_results_threads_thread',
'/<(.*?)(\s*?){\$lastpostdate}/',
'{+}forumdisplay_thread_lastpost|{$thread[\'lastposteruid\']}{-}<\\1\\2{$lastpostdate}'
);
find_replace_templatesets(
'private_messagebit',
'#'.preg_quote('{$tofromusername}').'#',
'{+}private_messagebit|{$tofromuid}{-}{$tofromusername}'
);
find_replace_templatesets(
'forumdisplay_announcements_announcement',
'#<(.*?)'.preg_quote('{$announcement[\'subject\']}').'#',
'{+}forumdisplay_announcements_announcement|{$announcement[\'fid\']}{-}<\\1{$announcement[\'subject\']}'
);
}

function lightavatars_deactivate() {
global $db, $cache;
$db->delete_query(
'themestylesheets',
'name="lightavatars.css" AND tid=1'
);

require_once MYBB_ADMIN_DIR."inc/functions_themes.php";
@unlink(MYBB_ROOT."cache/themes/theme1/lightavatars.css");
@unlink(MYBB_ROOT."cache/themes/theme1/lightavatars.min.css");
update_theme_stylesheet_list(1);

$db->delete_query("settinggroups", "name=\"lightavatars\"");
$db->delete_query("settings", "name LIKE \"lightavatars%\"");
rebuild_settings();

require_once MYBB_ROOT.'inc/adminfunctions_templates.php';
$deletepattern='#\{\+\}(.*?)\{-\}#';
find_replace_templatesets(
'forumdisplay_thread',
$deletepattern,
''
);
find_replace_templatesets(
'forumbit_depth1_forum_lastpost',
$deletepattern,
''
);
find_replace_templatesets(
'forumbit_depth2_forum_lastpost',
$deletepattern,
''
);
find_replace_templatesets(
'search_results_posts_post',
$deletepattern,
''
);
find_replace_templatesets(
'search_results_threads_thread',
$deletepattern,
''
);
find_replace_templatesets(
'private_messagebit',
$deletepattern,
''
);
find_replace_templatesets(
'forumdisplay_announcements_announcement',
$deletepattern,
''
);
}

class LightAvatars
{

public function getAvatars(&$content)
{
global $db, $mybb;

//input
preg_match_all('/\{\+\}(.*?)\|(.*?)\{\-\}/', $content, $matches);
if(!$matches[0]) {
return $content;
}

//getinfo
$matchescount=count($matches[0]);

while($matchescount--) {

$info[$matches[2][$matchescount]]['position'][$matches[1][$matchescount]]=1;
if($matches[2][$matchescount]!=0) {
$select[$matches[2][$matchescount]]=$matches[2][$matchescount];
} else {
$info[0]['avatar']='./'.$mybb->settings['useravatar'];
$info[0]['name']='unregistered';
}
}

//getdatafromdb
if(isset($select)) {
$selected='uid='.implode(' OR uid=',$select);
$avatardata=$db->simple_select(
'users',
'uid,username,avatar',
$selected,
NULL
);
while($base=$db->fetch_array($avatardata)) {
$info[$base['uid']]['avatar']=$base['avatar'];
$info[$base['uid']]['name']=$base['username'];
}
}

//setavatars
foreach($info as $key => $avatar) {

if(empty($avatar['avatar'])) {
$avatar['avatar']='./'.$mybb->settings['useravatar'];
}

if($key!==0) {
$avatargen=''.$mybb->settings['bbname'].'settings['bburl'].'/'.$mybb->settings['useravatar'].'\';">';
} else {
$avatargen=''.$mybb->settings['bbname'].'settings['bburl'].'/'.$mybb->settings['useravatar'].'\';">';
}

foreach($avatar['position'] as $position => $truevalue) {
if(!$masterstyle[$position]) {
$masterstyle[$position]=explode(' ',$mybb->settings['lightavatars_'.$position]);
$masterstyle[$position]="lavatar-".implode(" lavatar-",$masterstyle[$position]);
}
if($mybb->settings['lightavatars_custom']) {
$style['avatar']=' lavatar-'.$avatar['name'].'-'.$position;
}
$content=str_replace('{+}'.$position.'|'.$key.'{-}', '
'.$avatargen.'
', $content);
}
}
return $content;
}
}

hocam galiba mybb kodlarını ezberledin :)
ve galiba ben kendimi yanlış anlattım :( Aslında sormak istediğim şey;



Kullanmak yerine,

{$kullaniciAdi}


gibi bir yapı kullanmak. Laravelde bu {{$kullaniciadi}} şeklinde kullanılıyor. Fakat bunu fonksiyon şeklinde yazamadım.

Demek istediğimi daha iyi anlamak isterseniz,

https://github.com/hozakar/basitblog/releases/tag/v1.0.2

dosyasındaki yonetim\sablon\index.html dosyasını inceleyin.
 

 

Site Ayarları
  • Tema Seçeneği
  • Site Sesleri
  • Bildirimler
  • Özel Mesaj Al