mr.8pa4 1 Опубликовано: 8 августа 2011 Рассказать Опубликовано: 8 августа 2011 Заливаем файлы киномода в engine/modules Делаем запрос... ALTER TABLE `dle_post` ADD `year` VARCHAR( 5 ) NOT NULL , ADD `country` VARCHAR( 225 ) NOT NULL , ADD `genre` TEXT NOT NULL , ADD `datex` TEXT NOT NULL , ADD `director` TEXT NOT NULL , ADD `producer` TEXT NOT NULL , ADD `actors` TEXT NOT NULL; 1. В корне открываем .htacess и находим: # Редиректы RewriteRule ^page/(.*)$ index.php?cstart=$1 [L] Ниже вставляем # Киномод RewriteRule ^year/([0-9]+)(/?)+$ index.php?do=year&year=$1 [L] RewriteRule ^year/([0-9]+)/page/([0-9]+)(/?)+$ index.php?do=year&year=$1&cstart=$2 [L] RewriteRule ^country/([^/]*)(/?)+$ index.php?do=country&country=$1 [L] RewriteRule ^country/([^/]*)/page/([0-9]+)(/?)+$ index.php?do=country&country=$1&cstart=$2 [L] RewriteRule ^genre/([^/]*)(/?)+$ index.php?do=genres&genre=$1 [L] RewriteRule ^genre/([^/]*)/page/([0-9]+)(/?)+$ index.php?do=genres&genre=$1&cstart=$2 [L] RewriteRule ^datex/([^/]*)(/?)+$ index.php?do=datexs&datex=$1 [L] RewriteRule ^datex/([^/]*)/page/([0-9]+)(/?)+$ index.php?do=datexs&datex=$1&cstart=$2 [L] RewriteRule ^director/([^/]*)(/?)+$ index.php?do=directors&director=$1 [L] RewriteRule ^director/([^/]*)/page/([0-9]+)(/?)+$ index.php?do=directors&director=$1&cstart=$2 [L] RewriteRule ^producer/([^/]*)(/?)+$ index.php?do=producers&producer=$1 [L] RewriteRule ^producer/([^/]*)/page/([0-9]+)(/?)+$ index.php?do=producers&producer=$1&cstart=$2 [L] RewriteRule ^cast/([^/]*)(/?)+$ index.php?do=actors&actor=$1 [L] RewriteRule ^cast/([^/]*)/page/([0-9]+)(/?)+$ index.php?do=actors&actor=$1&cstart=$2 [L] 2.Открываем engine/inc/addnews.php После <div class="hr_line"></div> <table width="100%"> Добавить <tr> <td height="29" style="padding-left:5px;">Год:</td> <td><input class="edit" type="text" size="55" name="year" id="year"></td> </tr> <tr> <td height="29" style="padding-left:5px;">Страна:</td> <td><input class="edit" type="text" size="55" name="country" id="country"></td> </tr> <tr> <td height="29" style="padding-left:5px;">Жанр:</td> <td><input class="edit" type="text" size="55" name="genre" id="genre"></td> </tr> <tr> <td height="29" style="padding-left:5px;">Дата выхода:<br> число месяц:</td> <td><input class="edit" type="text" size="55" name="datex" id="datex"></td> </tr> <tr> <td height="29" style="padding-left:5px;">Режиссер:</td> <td><input class="edit" type="text" size="55" name="director" id="director"></td> </tr> <tr> <td height="29" style="padding-left:5px;">Продюсер:</td> <td><input class="edit" type="text" size="55" name="producer" id="producer"></td> </tr> <tr> <td height="29" style="padding-left:5px;">В ролях:</td> <td><textarea rows="5" style="width:600px;" name="actors"></textarea></td> </tr> После else $alt_name = totranslit( stripslashes( $alt_name ), true, false ); Добавить $year = $_POST['year']; $country = $_POST['country']; $genre = $_POST['genre']; $genrelist = explode(",", $genre); $genre = ''; $ngenre = count($genrelist); foreach($genrelist as $key=>$value) { $genre .= trim($value); if ($key < $ngenre-1) $genre .= "|"; } $datex = $_POST['datex']; $datexlist = explode(",", $datex); $datex = ''; $ndatex = count($datexlist); foreach($datexlist as $key=>$value) { $datex .= trim($value); if ($key < $ndatex-1) $datex .= "|"; } $director = $_POST['director']; $directorlist = explode(",", $director); $director = ''; $ndirector = count($directorlist); foreach($directorlist as $key=>$value) { $director .= trim($value); if ($key < $ndirector-1) $director .= "|"; } $producer = $_POST['producer']; $producerlist = explode(",", $producer); $producer = ''; $nproducer = count($producerlist); foreach($producerlist as $key=>$value) { $producer .= trim($value); if ($key < $nproducer-1) $producer .= "|"; } $actors = $_POST['actors']; $actorslist = explode(",", $actors); $actors = ''; $nactors = count($actorslist); foreach($actorslist as $key=>$value) { $actors .= trim($value); if ($key < $nactors-1) $actors .= "|"; } Заменить запрос $db->query( "INSERT INTO " . PREFIX . "_post (date, ... на $db->query( "INSERT INTO " . PREFIX . "_post (date, autor, short_story, full_story, xfields, title, descr, keywords, category, alt_name, allow_comm, approve, allow_main, fixed, allow_rate, allow_br, votes, access, symbol, flag, tags, metatitle, year, country, genre, datex, director, producer, actors) values ('$thistime', '{$member_id['name']}', '$short_story', '$full_story', '$filecontents', '$title', '{$metatags['description']}', '{$metatags['keywords']}', '$category_list', '$alt_name', '$allow_comm', '$approve', '$allow_main', '$news_fixed', '$allow_rating', '$allow_br', '$add_vote', '$group_regel', '$catalog_url', '1', '{$_POST['tags']}', '{$metatags['title']}', '$year', '$country', '$genre', '$datex', '$director', '$producer', '$actors')" ); 3. Открываем engine/inc/editnews.php После $row['metatitle'] = stripslashes( $row['metatitle'] ); Добавить $country = str_replace("|", ", ", $row['country']); $genre = str_replace("|", ", ", $row['genre']); $datex = str_replace("|", ", ", $row['datex']); $director = str_replace("|", ", ", $row['director']); $producer = str_replace("|", ", ", $row['producer']); $actors = str_replace("|", ", ", $row['actors']); После <div class="hr_line"></div> <table width="100%"> Добавить <tr> <td height="29" style="padding-left:5px;">Год:</td> <td><input class="edit" type="text" size="55" name="year" id="year" value="{$row['year']}"></td> </tr> <tr> <td height="29" style="padding-left:5px;">Страна:</td> <td><input class="edit" type="text" size="55" name="country" id="country" value="{$row['country']}"></td> </tr> <tr> <td height="29" style="padding-left:5px;">Жанр:</td> <td><input class="edit" type="text" size="55" name="genre" id="genre" value="{$genre}"></td> </tr> <tr> <td height="29" style="padding-left:5px;">Дата выхода:<br> число месяц:</td> <td><input class="edit" type="text" size="55" name="datex" id="datex" value="{$datex}"></td> </tr> <tr> <td height="29" style="padding-left:5px;">Режиссер:</td> <td><input class="edit" type="text" size="55" name="director" id="director" value="{$director}"></td> </tr> <tr> <td height="29" style="padding-left:5px;">Продюсер:</td> <td><input class="edit" type="text" size="55" name="producer" id="producer" value="{$producer}"></td> </tr> <tr> <td height="29" style="padding-left:5px;">В ролях:</td> <td><textarea rows="5" style="width:600px;" name="actors">{$actors}</textarea></td> </tr> После else { $full_story = $db->safesql( $parse->BB_Parse( $full_story, false ) ); $short_story = $db->safesql( $parse->BB_Parse( $short_story, false ) ); } Добавить $year = $_POST['year']; $country = $_POST['country']; $genre = $_POST['genre']; $genrelist = explode(",", $genre); $genre = ''; $ngenre = count($genrelist); foreach($genrelist as $key=>$value) { $genre .= trim($value); if ($key < $ngenre-1) $genre .= "|"; } $datex = $_POST['datex']; $datexlist = explode(",", $datex); $datex = ''; $ndatex = count($datexlist); foreach($datexlist as $key=>$value) { $datex .= trim($value); if ($key < $ndatex-1) $datex .= "|"; } $director = $_POST['director']; $directorlist = explode(",", $director); $director = ''; $ndirector = count($directorlist); foreach($directorlist as $key=>$value) { $director .= trim($value); if ($key < $ndirector-1) $director .= "|"; } $producer = $_POST['producer']; $producerlist = explode(",", $producer); $producer = ''; $nproducer = count($producerlist); foreach($producerlist as $key=>$value) { $producer .= trim($value); if ($key < $nproducer-1) $producer .= "|"; } $actors = $_POST['actors']; $actorslist = explode(",", $actors); $actors = ''; $nactors = count($actorslist); foreach($actorslist as $key=>$value) { $actors .= trim($value); if ($key < $nactors-1) $actors .= "|"; } Заменить $result = $db->query( "UPDATE " . PREFIX . "_post set title='$title', date='$thistime', short_story='$short_story', full_story='$full_story', descr='{$metatags['description']}', keywords='{$metatags['keywords']}', category='$category_list', alt_name='$alt_name', allow_comm='$allow_comm', approve='$approve', allow_main='$allow_main', allow_rate='$allow_rating', fixed='$news_fixed', allow_br='$allow_br', votes='$add_vote', access='$group_regel', symbol='$catalog_url', flag='1', editdate='$added_time', editor='{$member_id['name']}', reason='$editreason', view_edit='$view_edit', tags='{$_POST['tags']}', metatitle='{$metatags['title']}' WHERE id='$item_db[0]'" ); } else { $result = $db->query( "UPDATE " . PREFIX . "_post set title='$title', short_story='$short_story', full_story='$full_story', descr='{$metatags['description']}', keywords='{$metatags['keywords']}', category='$category_list', alt_name='$alt_name', allow_comm='$allow_comm', approve='$approve', allow_main='$allow_main', allow_rate='$allow_rating', fixed='$news_fixed', allow_br='$allow_br', votes='$add_vote', access='$group_regel', symbol='$catalog_url', editdate='$added_time', editor='{$member_id['name']}', reason='$editreason', view_edit='$view_edit', tags='{$_POST['tags']}', metatitle='{$metatags['title']}' WHERE id='$item_db[0]'" ); } На $result = $db->query( "UPDATE " . PREFIX . "_post set title='$title', year='$year', country='$country', genre='$genre', datex='$datex', director='$director', producer='$producer', actors='$actors', date='$thistime', short_story='$short_story', full_story='$full_story', xfields='$filecontents', descr='{$metatags['description']}', keywords='{$metatags['keywords']}', category='$category_list', alt_name='$alt_name', allow_comm='$allow_comm', approve='$approve', allow_main='$allow_main', allow_rate='$allow_rating', fixed='$news_fixed', allow_br='$allow_br', votes='$add_vote', access='$group_regel', symbol='$catalog_url', flag='1', editdate='$added_time', editor='{$member_id['name']}', reason='$editreason', view_edit='$view_edit', tags='{$_POST['tags']}', metatitle='{$metatags['title']}' WHERE id='$item_db[0]'" ); } else { $result = $db->query( "UPDATE " . PREFIX . "_post set title='$title', year='$year', country='$country', genre='$genre', datex='$datex', director='$director', producer='$producer', actors='$actors', short_story='$short_story', full_story='$full_story', xfields='$filecontents', descr='{$metatags['description']}', keywords='{$metatags['keywords']}', category='$category_list', alt_name='$alt_name', allow_comm='$allow_comm', approve='$approve', allow_main='$allow_main', allow_rate='$allow_rating', fixed='$news_fixed', allow_br='$allow_br', votes='$add_vote', access='$group_regel', symbol='$catalog_url', editdate='$added_time', editor='{$member_id['name']}', reason='$editreason', view_edit='$view_edit', tags='{$_POST['tags']}', metatitle='{$metatags['title']}' WHERE id='$item_db[0]'" ); } 4. Открываем engine/modules/show.short.php После $tpl->set( '{approve}', "" ); Добавить $genresList = explode('|',$row['genre']); $genres = ''; $cntGenres = count($genresList); $ai = 0; foreach ($genresList as $genre) { $ai++; $genre = trim($genre); $genres .= '<a href="/genre/'.urlencode(str_replace(' ','_',$genre)).'" title="'.$genre.'">'.$genre.'</a>'; if ($ai<$cntGenres) $genres .= ', '; } unset($genresList); if (!empty($row['genre'])) { $genreall= $genres; } $tpl->set( '{genreall}', $genreall); $datexsList = explode('|',$row['datex']); $datexs = ''; $cntDatexs = count($datexsList); $ai = 0; foreach ($datexsList as $datex) { $ai++; $datex = trim($datex); $datexs .= '<a href="/datex/'.urlencode(str_replace(' ','_',$datex)).'" title="'.$datex.'">'.$datex.'</a>'; if ($ai<$cntDatexs) $datexs .= ', '; } unset($datexsList); if (!empty($row['datex'])) { $datexall= $datexs; } $tpl->set( '{datexall}', $datexall); $directorsList = explode('|',$row['director']); $directors = ''; $cntDirectors = count($directorsList); $ai = 0; foreach ($directorsList as $director) { $ai++; $director = trim($director); $directors .= '<a href="/director/'.urlencode(str_replace(' ','_',$director)).'" title="'.$director.'">'.$director.'</a>'; if ($ai<$cntDirectors) $directors .= ', '; } unset($directorsList); if (!empty($row['director'])) { $directorall= $directors; } $tpl->set( '{directorall}', $directorall); $producersList = explode('|',$row['producer']); $producers = ''; $cntProducers = count($producersList); $ai = 0; foreach ($producersList as $producer) { $ai++; $producer = trim($producer); $producers .= '<a href="/producer/'.urlencode(str_replace(' ','_',$producer)).'" title="'.$producer.'">'.$producer.'</a>'; if ($ai<$cntProducers) $producers .= ', '; } unset($producersList); if (!empty($row['producer'])) { $producerall= $producers; } $tpl->set( '{producerall}', $producerall); $actorsList = explode('|',$row['actors']); $actors = ''; $cntActors = count($actorsList); $ai = 0; foreach ($actorsList as $actor) { $ai++; $actor = trim($actor); $actors .= '<a href="/cast/'.urlencode(str_replace(' ','_',$actor)).'" title="'.$actor.'">'.$actor.'</a>'; if ($ai<$cntActors) $actors .= ', '; } unset($actorsList); if (!empty($row['actors'])) { $actorall= $actors; } $tpl->set( '{actorall}', $actorall); $year1 = $row['year']; $tpl->set( '{year}', $year1!='' ? '<a href="/year/'.str_replace(' ','_',$year1).'" title="'.$year1.'">'.$year1.'</a>' : ''); $country = $row['country']; $tpl->set( '{country}', $year1!='' ? '<a href="/country/'.urlencode(str_replace(' ','_',$country)).'" title="'.$country.'">'.$country.'</a>' : ''); 5. Открываем engine/modules/show.full.php После $tpl->set( '{category-icon}', "{THEME}/dleimages/no_icon.gif" ); } Добавить $genresList = explode('|',$row['genre']); $genres = ''; $cntGenres = count($genresList); $ai = 0; foreach ($genresList as $genre) { $ai++; $genre = trim($genre); $genres .= '<a href="/genre/'.urlencode(str_replace(' ','_',$genre)).'" title="'.$genre.'">'.$genre.'</a>'; if ($ai<$cntGenres) $genres .= ', '; } unset($genresList); if (!empty($row['genre'])) { $genreall= $genres; } $tpl->set( '{genreall}', $genreall); $datexsList = explode('|',$row['datex']); $datexs = ''; $cntDatexs = count($datexsList); $ai = 0; foreach ($datexsList as $datex) { $ai++; $datex = trim($datex); $datexs .= '<a href="/datex/'.urlencode(str_replace(' ','_',$datex)).'" title="'.$datex.'">'.$datex.'</a>'; if ($ai<$cntDatexs) $datexs .= ', '; } unset($datexsList); if (!empty($row['datex'])) { $datexall= $datexs; } $tpl->set( '{datexall}', $datexall); $directorsList = explode('|',$row['director']); $directors = ''; $cntDirectors = count($directorsList); $ai = 0; foreach ($directorsList as $director) { $ai++; $director = trim($director); $directors .= '<a href="/director/'.urlencode(str_replace(' ','_',$director)).'" title="'.$director.'">'.$director.'</a>'; if ($ai<$cntDirectors) $directors .= ', '; } unset($directorsList); if (!empty($row['director'])) { $directorall= $directors; } $tpl->set( '{directorall}', $directorall); $producersList = explode('|',$row['producer']); $producers = ''; $cntProducers = count($producersList); $ai = 0; foreach ($producersList as $producer) { $ai++; $producer = trim($producer); $producers .= '<a href="/producer/'.urlencode(str_replace(' ','_',$producer)).'" title="'.$producer.'">'.$producer.'</a>'; if ($ai<$cntProducers) $producers .= ', '; } unset($producersList); if (!empty($row['producer'])) { $producerall= $producers; } $tpl->set( '{producerall}', $producerall); $actorsList = explode('|',$row['actors']); $actors = ''; $cntActors = count($actorsList); $ai = 0; foreach ($actorsList as $actor) { $ai++; $actor = trim($actor); $actors .= '<a href="/cast/'.urlencode(str_replace(' ','_',$actor)).'" title="'.$actor.'">'.$actor.'</a>'; if ($ai<$cntActors) $actors .= ', '; } unset($actorsList); if (!empty($row['actors'])) { $actorall= $actors; } $tpl->set( '{actorall}', $actorall); $year1 = $row['year']; $tpl->set( '{year}', $year1!='' ? '<a href="/year/'.str_replace(' ','_',$year1).'" title="'.$year1.'">'.$year1.'</a>' : ''); $country = $row['country']; $tpl->set( '{country}', $year1!='' ? '<a href="/country/'.urlencode(str_replace(' ','_',$country)).'" title="'.$country.'">'.$country.'</a>' : ''); 6. Открываем engine/engine.php Находим, их там много:(17-ть замен) id, autor, date, Заменяем на: id, autor, year, country, genre, datex, director, producer, actors, date, После case "alltags" : include_once ENGINE_DIR . '/modules/tagscloud.php'; break; Добавить case "genres" : include_once ENGINE_DIR . '/modules/genres.php'; break; case "datexs" : include_once ENGINE_DIR . '/modules/datexs.php'; break; case "directors" : include_once ENGINE_DIR . '/modules/directors.php'; break; case "producers" : include_once ENGINE_DIR . '/modules/producers.php'; break; case "actors" : include_once ENGINE_DIR . '/modules/actors.php'; break; case "year" : include_once ENGINE_DIR . '/modules/year.php'; break; case "country" : include_once ENGINE_DIR . '/modules/country.php'; break; 7. В шаблон shortstory.tpl и fullstory.tpl в нужное место вставить: {year} {country} {genreall} {datexall} {directorall} {producerall} {actorall}и к этим фигням нужны файлыесли когото интересует .. я могу помочьнапоминаю .. инфо не полное .. и не имя опыта и знаний не лезти в дебри Цитата Ссылка на сообщение Поделиться на других сайтах
a1ex 60 Опубликовано: 9 августа 2011 Рассказать Опубликовано: 9 августа 2011 велосипед Цитата Ссылка на сообщение Поделиться на других сайтах
promax 0 Опубликовано: 24 октября 2011 Рассказать Опубликовано: 24 октября 2011 сделать бы список , а не однострочное поле Цитата Ссылка на сообщение Поделиться на других сайтах
djon198360 4 Опубликовано: 25 октября 2011 Рассказать Опубликовано: 25 октября 2011 if( $row['foto'] ) {$avatar = $config['http_home_url'] . "uploads/fotos/" . $row['foto'];} else {$avatar = "engine/skins/images/noavatar.png";} Вот код проверки фото загружено иначе в аватар ноаватар.png Мне нужно сделать что бы шла проверка Фото загружено если нет то проверить доп поле на заполненость а вот если и доп поле пустое то ставить ноаватар.png что то типа того что я ниже написал ,но в рнр не силен так что что то не могу выводится или фото или ноаватар . Помогите сделать . if( $row['foto'] ) {$avatar = $config['http_home_url'] . "uploads/fotos/" . $row['foto'];} if( $row['foto'] =0) { $xfieldsdata = xfieldsdataload( $row['xfields']); $avatar = (stripslashes($xfields['avatar'])); } else {$avatar = "engine/skins/images/noavatar.png"; } Цитата Ссылка на сообщение Поделиться на других сайтах
djon198360 4 Опубликовано: 26 октября 2011 Рассказать Опубликовано: 26 октября 2011 все разобрался сам. Цитата Ссылка на сообщение Поделиться на других сайтах
Рекомендованные сообщения
Присоединяйтесь к обсуждению
Вы можете опубликовать сообщение сейчас, а зарегистрироваться позже. Если у вас есть аккаунт, войдите в него для написания от своего имени.