میرم سر اموزش این کد
خوب شروع میکنیم:
ابتدا فایل Sources/Subs.php باز کنید و کد زیرو پیدا کنید:
اینو به قبلش اضافه کنید:کد:// Cache the output if it took some time... if (isset($cache_key, $cache_t) && array_sum(explode(' ', microtime())) - array_sum(explode(' ', $cache_t)) > 0.05) cache_put_data($cache_key, $message, 240);
حالا فایل index.template.php قالبتونو باز کنید و کد زیرو پیدا کنید:کد:// Integrate Lightbox Mod: Start // Disable for signatures & on stats page if((empty($cache_id) || substr($cache_id, 0, 3) != 'sig') && $context['current_action'] != 'stats' && $context['current_action'] != 'garage') { // Grab all linked and non-linked images if(preg_match_all('~(<a href="([^"]*?)"(?:[^>]*?)>|)(<img src="((?!'. preg_quote($modSettings['smileys_url'], '#') .').*?)"(?:[^>]*?)>)?(?:</a>|)~ism'.($context['utf8'] ? 'u' : ''), $message, $images, PREG_SET_ORDER)) { // Output key of images - for each match // 0. entire match // 1. <a> or blank // 2. url or blank // 3. <img> // 4. imageurl // 5. Replacement string // Cycle through each image foreach($images as $a => $b) { // Non-linked images won't have all the data, so make it up if(empty($b[1]) && empty($b[2]) && !empty($b[3]) && !empty($b[4])) { $b[1] = '<a href="'.$b[4].'">'; $b[2] = $b[4]; $b[5] = '<a href="'.$b[4].'">'.$b[3].'</a>'; } else $b[5] = $b[0]; // Match images hosted by Imageshack or Photobucket $c = @parse_url($b[4]); $c = empty($c['host']) ? '' : $c['host']; if(strpos($c, 'imageshack') !== false) { // Fix Imageshack thumbnails and for non-direct page links if(preg_match('~(.*?)\.(?:th\.|)(png|gif|jp(e)?g|bmp)$~is'.($context['utf8'] ? 'u' : ''), $b[4], $out)) { $out = $out[1].'.'.$out[2]; $d = $b[1]; $b[1] = str_replace($b[2], $out, $b[1]); $b[2] = $out; $b[5] = str_replace($d, $b[1], $b[5]); unset($c, $d, $out); } } elseif(strpos($c, 'photobucket') !== false) { // Fix Photobucket thumbnails if(preg_match('~(.*?)/(?:th_|)([^/]*?)\.(png|gif|jp(e)?g|bmp)$~is'.($context['utf8'] ? 'u' : ''), $b[4], $out)) { $out = $out[1].'/'.$out[2].'.'.$out[3]; $d = $b[1]; $b[1] = str_replace($b[2], $out, $b[1]); $b[2] = $out; $b[5] = str_replace($d, $b[1], $b[5]); unset($c, $d, $out); } } // Add rel="lightbox" if(empty($b[2])) $b[2] = ''; if(preg_match('~(.*?)\.(png|gif|jp(e)?g|bmp)$~is'.($context['utf8'] ? 'u' : ''), $b[2])){ $c = $b[1]; $b[1] = str_replace($b[2], $b[2].'" rel="lightbox[smf]', $b[1]); $b[5] = str_replace($c, $b[1], $b[5]); } // Replace the link in the message $message = str_replace($b[0], $b[5], $message); // Tidy up unset($a, $b, $c, $d); } // Tidy up unset($a, $b, $links); } } // Integrate Lightbox Mod: End
اینو بعدش بذارین:کد:<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?fin11" media="print" />';
فایل Display.template.php قالبتونو باز کنید و کد زیرو پیدا کنید:کد:// Include the Lightbox Scripts (except for the stats page and SMF Garage) if($context['current_action'] != 'stats' && $context['current_action'] != 'garage') echo ' <!-- Integrate Lightbox Mod: Start --> <!-- MooTools Includes --> <script type="text/javascript" src="', $settings['default_theme_url'], '/mootools1.11.js"></script> <!-- Lightbox Includes --> <script type="text/javascript" src="', $settings['default_theme_url'], '/slimbox.js"></script> <link rel="stylesheet" href="', $settings['default_theme_url'], '/slimbox.css" type="text/css" media="screen" /> <!-- Integrate Lightbox Mod: End -->';
حالا این کدو جای گزین کنید:کد:echo ' <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
منبع فقط:کد:echo ' <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" rel="lightbox[smf]"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
[مهمان/کاربر گرامی برای دیدن لینک ها ابتدا باید عضو سایت شوید و لاگین کنید برای ثبت نام اینجا کلیک کنید]
البته یه سری عکس داره که دارم اپ میکنم(مثلا خطم 512 هستش ولی از اپ کردن یه عکس چند کیلو بایتی بر نمیاد ;D)





علاقه مندی ها (Bookmarks)