Yangi formatda davom etish uchun: https://uzfor.net/view.php?id=90&page=27
JohnCMS da bosh sahifaga chiqarish
Mavzu fayllari (15)
Xabarlar
Manga library tagsdagi maqolalarni sanaydigan kod kerak. yurakcha.ru/sitemap.php dagi teg bo'yicha menyularda nechta maqola borligini ko'rsatadigan. Bilselar etvoringlar...
<?php echo ' <div class="phdr"> <b><i class="fa fa-refresh" style="color:#ffffff;"></i> Tasodifiy maqola:</b></div> <div class="list1"> <i class="fa fa-certificate" style="color:#191970;"></i> <b><a href="/library/index.php?id='.$tasodif['id'].'">'.$tasodif['name'].'</a></b><br> '.$matn.'... <a href="/library/index.php?id='.$tasodif['id'].'"><font color=#B00000>davomi</font></a> </div> '; } ?>
Kod ishlamayapdi
Yordam kerak.
#ᴋᴀᴍʀᴏɴ, # #ᴋᴀᴍʀᴏɴ (13.01.2021 / 15:33)
<?php
$tasodifiy_maqola = mysql_query("SELECT * FROM `library_texts` ORDER BY RAND() LIMIT 1");
while ($tasodif = mysql_fetch_assoc($tasodifiy_maqola)) {
$matn = mb_substr($tasodif['text'], 0,Faqat bitta maqolani olayotgan bo`lsangiz nega while ishlatyapsiz ? keyn nega hammasini olyapsiz ? ikkita narsaga bazani qiynamang. * qo`yish kerak emas
p/s: kodni ishlatib ko`rmadim
<?php
$tasodifiy_maqola = mysql_query("SELECT * FROM `library_texts` ORDER BY RAND() LIMIT 1");
while ($tasodif = mysql_fetch_assoc($tasodifiy_maqola)) {
$matn = mb_substr($tasodif['text'], 0,Faqat bitta maqolani olayotgan bo`lsangiz nega while ishlatyapsiz ? keyn nega hammasini olyapsiz ? ikkita narsaga bazani qiynamang. * qo`yish kerak emas
$tasodifiy_maqola = mysql_fetch_assoc(mysql_query("SELECT `id`, `name` FROM `library_texts` ORDER BY RAND() LIMIT 1")); echo '<div class="phdr">'. '<b><i class="fa fa-refresh" style="color:#ffffff;"></i> Tasodifiy maqola:</b></div> '. '<div class="list1">'. '<i class="fa fa-certificate" style="color:#191970;"></i>'. '<b><a href="/library/index.php?id='.$tasodifiy_maqola['id'].'">'.$tasodifiy_maqola['name'].'</a></b>'. '<br>'.$matn.'...<a href="/library/index.php?id='.$tasodifiy_maqola['id'].'">'. '<font color="#B00000">davomi</font></a>'. '</div>';
p/s: kodni ishlatib ko`rmadim
Akbarali, # Akbarali (13.01.2021 / 19:18)
#ᴋᴀᴍʀᴏɴ, Faqat bitta maqolani olayotgan bo`lsangiz nega while ishlatyapsiz ? keyn nega hammasini olyapsiz ? ikkita narsaga bazani qiynamang. * qo`yish kerak emas
$tasodifiy_maqola = mysql_fetch_aMendagi kod ishlayotgan ekan. Ayb menda.)
#ᴋᴀᴍʀᴏɴ, Faqat bitta maqolani olayotgan bo`lsangiz nega while ishlatyapsiz ? keyn nega hammasini olyapsiz ? ikkita narsaga bazani qiynamang. * qo`yish kerak emas
$tasodifiy_maqola = mysql_fetch_aMendagi kod ishlayotgan ekan. Ayb menda.)
Uzhost, Shu kodni so'radimda
31 soniyadan keyin yozdi:
31 soniyadan keyin yozdi:
<?php /** * @package JohnCMS * @link http://johncms.com * @copyright Copyright (C) 2008-2011 JohnCMS Community * @license LICENSE.txt (see attached file) * @version VERSION.txt (see attached file) * @author http://johncms.com/about * * @var $lng_dl */ $headmod = 'loadview'; require_once '../incfiles/core.php'; require_once 'functions.php'; { $file22 = mysql_query("SELECT * FROM `downfiles` WHERE `pathid` = '" . $viewf . "' AND `type` = 1"); require_once '../incfiles/head.php'; if (!$file['size']) { } else { $siz = $file['size']; } $nadir = $file['pathid']; $pat = ""; while ($nadir != "") { $pat = '<a href="dir_' . $dnew1['id'] . '.html" title="' . $dnew1['name'] . '">' . $dnew1['name'] . '</a> > ' . $pat; $nadir = $dnew1[refid]; } echo '<div class="phdr"><a href="/download/">'.$lng_dl['downloads'].'</a> ' . $pat . ']</div>'; echo '<div class="menu">'.$lng_dl['rating'].': ' . $rating = $file['rating'] ? $file['rating'] : '0'; echo '<br/>'; echo rat_star($file['rating']) . '</div>'; { echo '<div class="menu">'.$lng_dl['set_mark'].': <a href="index.php?act=rat&id=' . $file['id'] . '&rat=1">1</a> | <a href="index.php?act=rat&id=' . $file['id'] . '&rat=2">2</a> |<a href="index.php?act=rat&id=' . $file['id'] . '&rat=3">3</a> | <a href="index.php?act=rat&id=' . $file['id'] . '&rat=4">4</a> | <a href="index.php?act=rat&id=' . $file['id'] . '&rat=5">5</a></div>'; } echo '<div class="menu"><b>'.$lng_dl['file_type'].':</b> ' . $tf . '</div>'; ////////////////////////// ////// Скриншоты ///////// ////////////////////////// $scr = mysql_result(mysql_query("SELECT COUNT(*) FROM `downscreen` WHERE `fileid` = '".$viewf."'"), 0); if ($scr) { echo '<div class="menu">'; $i = 1; { if ($i == 1) { if ($down_setting['screenshot']) echo '<img src="graftemp/' . $screen1[way] . '" alt="Скриншот..."/><br/>'; echo $lng_dl['screen'].': '; } { $img = new ImageEdit($screenroot . '/' . $screen1['way'], $down_setting['scr_size']); $img->setQuality(90); if ($down_setting['scr_copy']) $img->setCopy($down_setting['scr_copy_size'], $down_setting['scr_copy_text']); $img->saveImage('graftemp/' . $screen1[way]); } echo '<a href="getthumb.php?file=screens/' . $screen1[way] . '&size=0&q=100&copy=' . $down_setting['scr_copy_text'] . '">' . $i . '</a> '; $i++; } echo '<br/>'; echo '</div>'; } ///////////////////////// ///// Скрин к темам ///// ///////////////////////// echo '<div class="menu">'; if ($down_setting['screenview']) { if ($tf == 'thm') { autoscreen_thm($loadroot . '/' . $file['way'], 128, 160, $loadroot . '/' . $file['way'] . '.GIF'); echo '<img src="' . $loadroot . '/' . $file['way'] . '.GIF" alt="'.$lng_dl['screen'].'"/><br/>'; } elseif ($tf == 'nth') { autoscreen_nth($loadroot . '/' . $file['way'], 128, 160, $loadroot . '/' . $file['way'] . '.GIF'); echo '<img src="' . $loadroot . '/' . $file['way'] . '.GIF" alt="'.$lng_dl['screen'].'"/><br/>'; } } ///////////////////////// ///// Скрин к видео ///// ///////////////////////// //TODO:Переделать обработку видео... if ($tf == '3gp' or $tf == 'avi' or $tf == 'mp4') { if ($down_setting['screenvideo']) { autoscreen_video($loadroot . '/' . $file['way'], $loadroot . '/' . $file['way'] . '.GIF', 132, 96); echo '<img src="' . $loadroot . '/' . $file['way'] . '.GIF" alt="'.$lng_dl['screen'].'"/><br/>'; } if ($down_setting['infvideo']) { $media = new ffmpeg_movie($loadroot . '/' . $file['way']); echo $lng_dl['frame_size'].': ' . $media->getFrameHeight() . 'x' . $media->getFrameWidth() . '<br/>'; echo $lng_dl['bitrate'].': ' . $media->getVideoBitRate() . 'kpbs <br/>'; } } //////////////////////////////////// //////// Скрин к картинке ////////// //////////////////////////////////// if ($tf == 'gif' or $tf == 'png' or $tf == 'jpg' or $tf == 'jpeg') { if (!$down_setting['screencache']) { echo '<img src="getthumb.php?file=' . $loadroot . '/' . $file['way'] . '&size=120" alt="'.$lng_dl['screen'].'"/><br/>'; } else { { $img = new ImageEdit($loadroot . '/' . $file['way'], $down_setting['scr_size']); // Подаём оригинал и максимальный размер $img->setQuality(90); // Качество if ($down_setting['scr_copy']) $img->setCopy($down_setting['scr_copy_size'], $down_setting['scr_copy_text']); $img->saveImage('graftemp/' . $file['id'] . '.big.' . $tf); // Сохраняем во временную папку } echo '<img src="graftemp/' . $file['id'] . '.big.' . $tf . '" alt="'.$lng_dl['screen'].'"/><br/>'; } } echo '<b>'.$lng_dl['added'].':</b> ' . $filtime . '</div>'; if ($file['login']) { echo '<div class="menu"><b>'.$lng_dl['creator'].':</b> <a href="../users/profile.php?user=' . $file['user_id'] . '">' . $file['login'] . '</a></div>'; } echo '<div class="menu"><b>'.$lng_dl['loaded'].':</b> ' . ending($file['count']) . '</div>'; /////////////////////////////// //////// Если это JAR ///////// /////////////////////////////// if ($tf == 'jar') { $archive2 = new JarInfo($loadroot . '/' . $file['way']); //$archive2->setDeleteConfirm('Скачать программу повторно можно с сайта symbos.su'); //$archive2->saveManifest(); if ($down_setting['jar_version'] > 0 && $archive2->getVersion()) echo '<div class="menu"><b>'.$lng_dl['version'].':</b> ' . $archive2->getVersion() . '</div>'; if ($down_setting['jar_name'] > 0 && $archive2->getName()) echo '<div class="menu"><b>'.$lng_dl['name'].':</b> ' . $archive2->getName() . '</div>'; if ($down_setting['jar_vendor'] > 0 && $archive2->getVendor()) echo '<div class="menu"><b>'.$lng_dl['vendor'].':</b> ' . $archive2->getVendor() . '</div>'; if ($down_setting['jar_profile'] > 0 && $archive2->getProfile()) echo '<div class="menu"><b>'.$lng_dl['profile'].':</b> ' . $archive2->getProfile() . '</div>'; if ($down_setting['jar_url'] > 0 && $archive2->getUrl()) echo '<div class="menu"><b>Url:</b> ' . $archive2->getUrl() . '</div>'; // Получаем иконку если её ещё нет. $icon = 'graftemp/' . $file['id'] . '.icon.png'; { if (!$archive2->getIcon('graftemp/' . $file['id'] . '.icon.png')) $icon = 'img/jar.png'; } } /////////////////////// ////// Описание /////// /////////////////////// echo '<div class="menu">'; if ($file['desc']) { echo functions::checkout($file['desc'], 1, 1); } else { echo $lng_dl['description_is_empty']; } echo '</div>'; ///////////////////////// ////// Инфа о mp3 /////// ///////////////////////// if ($down_setting['mp3info']) { if ($tf == 'mp3') { echo '<div class="menu">'; require_once 'classes/classAudioFile.php'; $f = new AudioFile; // добавляем аудиофайл $f->loadFile($loadroot . '/' . $file[way]); // выводим информацию echo '<b>'.$lng_dl['play'].':</b> <br/>'; echo '<object type="application/x-shockwave-flash" data="mp3player.swf" width="200" height="20" id="mp3player" name="mp3player">'; echo '<param name="movie" value="mp3player.swf" />'; echo '<param name="flashvars" value="mp3=' . $loadroot . '/' . $file['way'] . '" />'; echo '</object>'; echo '</div>'; } } /////////////////////////////////// ////// Обсуждение на форуме /////// /////////////////////////////////// if ($file['themeid']) { echo '<div class="menu"><img src="img/peopl.png" alt="."/> <a href="../forum/index.php?id=' . $file['themeid'] . '">'.$lng_dl['discussion_on_forum'].'</a></div>'; } echo '<div class="menu"><small>'.str_replace('#FILE_ID#', $viewf, $lng_dl['policies']).'</small></div>'; if ($dostguest == 'open') { if (!$namee[1]) { $namee[1] = $lng_dl['primary_file']; } $icon = 'img/save.png'; echo '<div class="menu"><img src="' . $icon . '" alt="."/> <a href="loadfile.php?down=' . $file['way'] . '">'.$lng_dl['download'].' ' . $namee[1] . '</a>'; ////////////////////////// ////// Получаем JAD ////// ////////////////////////// if ($tf == 'jar' && $down_setting['jadgen']) { $jarurl = '' . $home . '/' . $downpat . '/' . $file['way']; //// Адрес файла записываемый в JAD $archive2->getJad($jarurl); echo ' <a href="loadfile.php?down=' . $file['way'] . '&jad=1">[JAD]</a>'; } echo ' [' . $file['count'] . ']</div>'; /////////////////////////////////////// ///// Выбор размеров для картинок ///// /////////////////////////////////////// if ($tf == 'gif' || $tf == 'jpg' || $tf == 'png') { echo " <div class='menu'> <form action='image.php' method='get'> <img src=\"img/view.png\" alt='.'/> <b>".$lng_dl['download_with_size'].":</b><br/> <select title='Выберите размер' name='size'>"; echo '<option value="640x480">640x480</option><option value="240x320">240x320</option><option value="208x208">208x208</option><option value="176x220">176x220</option><option value="176x208">176x208</option><option value="132x176">132x176</option><option value="128x160">128x160</option></select> <input type="hidden" name="file" value="' . $loadroot . '/' . $file['way'] . '"/> <input type="submit" value="'.$lng_dl['download'].'"/></form></div>'; } /////////////////////////////// ////// Просмотр архивов /////// /////////////////////////////// if ($down_setting['zipview']) { if ($tf == "zip") { echo '<div class="menu"><img src="img/rar.png" alt="."/> <a href="zipview.php?file_id=' . $viewf . '">'.$lng_dl['view_zip'].'</a></div>'; } } echo '<div class="menu">'.$lng_dl['copy_url'].':<br/> '/loadfile.php?down=' . $file['way'] . '"/></div>'; //////////////////////////////// ///// Дополнительные файлы ///// //////////////////////////////// { { echo '<div class="menu"><img src="img/save.png" alt="."/> <a href="loadfile.php?down=' . $file2['way'] . '">'.$lng_dl['download'].' ' . $file2['name'] . '</a>'; if ($tf == "jar" && $down_setting['jadgen']) { $archive2 = new JarInfo($loadroot . '/' . $file2['way']); $jarurl = '' . $home . '/' . $downpat . '/' . $file2['way']; //// Адрес файла записываемый в JAD $archive2->getJad($jarurl); echo ' <a href="loadfile.php?down=' . $file2['way'] . '&jad=1">[JAD]</a>'; } echo ' [' . $file2['count'] . ']<br/>'.functions::checkout($file2['desc'], 1, 1).'</div>'; if ($tf == "zip" && $down_setting['zipview']) echo '<img src="img/rar.png" alt="."/> <a href="zipview.php?file_id=' . $viewf . '">'.$lng_dl['view_zip'].'</a><br/>'; } } } else { echo '<b>'.$lng_dl['download_register_only'].'</b><br/>'; } ////////////////////////////////// /////// Поделиться ссылкой /////// ////////////////////////////////// ?> <div class="menu"> <script type="text/javascript" src="//yastatic.net/share/share.js" charset="utf-8"></script><div class="yashare-auto-init" data-yashareL10n="ru" data-yashareType="button" data-yashareQuickServices="vkontakte,facebook,twitter,odnoklassniki,moimir"></div> </div> <?php if ($down_setting['komm']) { $totalk = mysql_result(mysql_query("SELECT COUNT(*) FROM `downkomm` WHERE `fileid` = '" . $viewf . "';"), 0); echo '<div class="menu"><img src="img/edit.png" alt="."/> <a href="komm.php?id=' . $viewf . '">'.$lng_dl['comments'].'</a> (' . $totalk . ')</div>'; } if ($user_id) echo '<div class="menu"><img src="img/apply.png" alt="."/> <a href="index.php?act=bookmarks&dejst=add&id=' . $viewf . '">'.$lng_dl['add_bookmark'].'</a></div>'; } else { echo '<div class="rmenu">'.$lng_dl['file_not_found'].'</div>'; } echo '<div class="phdr"><a href="dir_' . $file['pathid'] . '.html">'.$lng['back'].'</a></div>'; require_once '../incfiles/end.php';
echo '<div class="menu">';
//////////////////////////
////// Скриншоты /////////
//////////////////////////
$scr = mysql_result(mysql_query("SELECT COUNT(*) FROM downscreen WHERE fileid = '".$viewf."'"), 0);
if ($scr)
{
$screen = mysql_query("SELECT * FROM downscreen WHERE fileid = '".$viewf."'");
$i = 1;
while ($screen1 = mysql_fetch_array($screen))
{
if ($i == 1)
{
if ($down_setting['screenshot'])
echo '<div class="sect fcols fx-row">
<div class="fleft">
<div class="fimg img-fit"><img src="graftemp/' . $screen1[way] . ' " alt="Скриншот..."/></div></div>' ;
}
}
} else { echo '<div class="sect fcols fx-row">
<div class="fleft">
<div class="fimg img-fit"><img src="/images/cower.png" alt="sayt.uz" /></div>
<div class="ffav icon-left">
</div>
</div>'; }
Bu johncms download/file.php
Dagi kod bunda joylangan yuklamalar rasmi joylansa, Usha joylangan rasm joylanmasa men kursatgan rasm erkanga chiqadi
Endi shu kodni Bosh sahifaga xuddi shunday chiqarish kodini yozib berizlar yaxshi tushunadiganlar Manda uxshamayapti
Yani Usha yuklamaga joylangan rasm Bosh sahifaga ham chiqishi kerak
//////////////////////////
////// Скриншоты /////////
//////////////////////////
$scr = mysql_result(mysql_query("SELECT COUNT(*) FROM downscreen WHERE fileid = '".$viewf."'"), 0);
if ($scr)
{
$screen = mysql_query("SELECT * FROM downscreen WHERE fileid = '".$viewf."'");
$i = 1;
while ($screen1 = mysql_fetch_array($screen))
{
if ($i == 1)
{
if ($down_setting['screenshot'])
echo '<div class="sect fcols fx-row">
<div class="fleft">
<div class="fimg img-fit"><img src="graftemp/' . $screen1[way] . ' " alt="Скриншот..."/></div></div>' ;
}
}
} else { echo '<div class="sect fcols fx-row">
<div class="fleft">
<div class="fimg img-fit"><img src="/images/cower.png" alt="sayt.uz" /></div>
<div class="ffav icon-left">
</div>
</div>'; }
Bu johncms download/file.php
Dagi kod bunda joylangan yuklamalar rasmi joylansa, Usha joylangan rasm joylanmasa men kursatgan rasm erkanga chiqadi
Endi shu kodni Bosh sahifaga xuddi shunday chiqarish kodini yozib berizlar yaxshi tushunadiganlar Manda uxshamayapti
Yani Usha yuklamaga joylangan rasm Bosh sahifaga ham chiqishi kerak
Besthakker,
Adashmasam shunday, sal teparoqni qarasez u yerda ham boshqacharoq varianti yozilgan ekan
echo '<div class="phdr">Tasodifi 10 ta kutubxona bolimlari</div>'; echo '<div class="menu"> <a href="'.$home.'/library/?do=dir&id='.$res['id'].'"> '.$res['name'].' </a> </div>'; }
Adashmasam shunday, sal teparoqni qarasez u yerda ham boshqacharoq varianti yozilgan ekan
Tavsiya etamiz:
- Hoziroq maydonlarni to'ldiring va reklamangizni joylashtiring!
Mavzuga oid xabarlar soni: 536 ta
So'ngi faollik vaqti: 02:12:02, 25 Feb 2021