A
A
Alexey Tutubalin2015-01-12 22:22:37
PHP
Alexey Tutubalin, 2015-01-12 22:22:37

How to get title in dl in php?

How to get the title of the current news in DLE in php?? I am writing a module and I need to drive the title of the current news into a variable for trimming further. There is a cropping script, but I don’t know how to get the current page title

<?php
if (!defined('DATALIFEENGINE')) die("die!");
  define('ROOT_DIR', '../..');
  define('ENGINE_DIR', '..');
  require_once(ENGINE_DIR.'/data/config.link.php');
  require_once(ENGINE_DIR.'/data/config.php');
  require_once ENGINE_DIR . '/classes/mysql.php';
  require_once ENGINE_DIR . '/data/dbconfig.php';
  require_once ENGINE_DIR . '/modules/functions.php';
  require_once(ENGINE_DIR.'/modules/show.full.php');							

@error_reporting ( E_ALL ^ E_WARNING ^ E_NOTICE );
  @ini_set ( 'display_errors', true );
  @ini_set ( 'html_errors', false );
  @ini_set ( 'error_reporting', E_ALL ^ E_WARNING ^ E_NOTICE );
  @session_start();
  @header("Content-type: text/html; charset={$config['charset']}");
  
    $str = {title};	
    $pm = array();
    preg_match('/\([0-9]{4}\)/', $str, $pm);
    $ps = preg_split('/\([0-9]{4}\)/', $str);
    $name = $ps[0].$pm[0];
    echo $name;	
  
  if(!$text) $text = "Смотреть онлайн $name";
    echo "<a href=\"http://site.ru/index.php?story=$name&do=search&subaction=search\" target=\"_blank\" >{$text}</a>";
?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IceJOKER, 2015-01-12
@IceJOKER

Is $str = {title}
n't it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question