DLE hacks
Additional fields by category [any DLE version]
26-12-2022, 11:51
Probably many people have seen how the pages on kinopoisk are arranged.
That is, the page on the movie itself has the form.
case "pm" :
include ENGINE_DIR . '/modules/pm.php';
break;
Connecting the module
case "posters" :
include ENGINE_DIR . '/modules/posters.php';
break;
Creating a file posters.php and throw it in engine/modules
We write the code in the file.
<?php
$id_news = $_GET['id_news']; //successor of our news id
$row = $db->query("SELECT * FROM ".PREFIX."_post WHERE id='$id_news'");
while($list = $db->get_row( $row ))
{
What to output for example $title = $list['title']; will pull the name of the news from the database
}
What to include in the template. for example $tpl->set( '{title}', $title); Will output the name of the news
$tpl->load_template( 'fullstory.tpl' ); //Your template is in the theme folder.
$tpl->compile( 'content' );
$tpl->clear();
?>
In the file .htaccess is being added
RewriteRule ^film/([0-9]+)/posters(/?)+$ index.php?do=posters&id_news=$1 [L]
Now follow the link http://ваш <url> website/film/id news/posters
There will be a page with our module that will display any information by the news id.To make other pages, we do it first for each page.
We are changing the name of the files and the module!
26-12-2022, 11:51
26-12-2022, 13:32
26-12-2022, 14:14
There are no comments
Information
Users of Visitor are not allowed to comment this publication.