1. Question image

Question image

  |   2
Question image


1. Open /engine/modules/functions.php:


if( ! defined( 'DATALIFEENGINE' ) ) {
die( "Hacking attempt!" );

Below Add:
function question_img($i) {
$img = ( substr($i[1], 0, 4)=="http" ) ? $i[1] : "/uploads/question/{$i[1]}";
return "<br><img src=\"{$img}\" />";

2. Open /engine/modules/register.php

$tpl->set( '{question}', htmlspecialchars( stripslashes( $question['question'] ), ENT_QUOTES ) );


$tpl->set( '{question}', htmlspecialchars( stripslashes( $question['question'] ), ENT_QUOTES, $config['charset'] ) );

Replace with:
$question['question'] = preg_replace_callback( "#\[img=(.+?)\]#is", "question_img", $question['question'] );
$tpl->set( '{question}', stripslashes( $question['question'] ) );

3. Open /engine/modules/show.full.php

$tpl->set( '{question}', "<span id=\"dle-question\">".htmlspecialchars( stripslashes( $question['question'] ), ENT_QUOTES )."</span>" );


$tpl->set( '{question}', "<span id=\"dle-question\">".htmlspecialchars( stripslashes( $question['question'] ), ENT_QUOTES, $config['charset'] )."</span>" );

Replace with:
$question['question'] = preg_replace_callback( "#\[img=(.+?)\]#is", "question_img", $question['question'] );
$tpl->set( '{question}', "<span id=\"dle-question\">".stripslashes( $question['question'] )."</span>" );

4. Create directory: /uploads/question
Place your images in this directory by exemple: 1.jpg, 2.jpg
Sample Questions
enter the title of this film ? [img=1.jpg]

In Answer:
blade (exemple l'image 1.jpg represents the film blade)

Live Demo:max-warez.net
For Dle10.0 Demo:http://max-warez.cu.cc/index.php?do=register
Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.



Comments 2

Commented By Discuz on January 29, 2015 (4:31 pm)
does not work
N/A 1Forum topics : 0Forum replies : 0Forum likes : 0
Commented By DLEStarter on January 29, 2015 (4:45 pm)
Quote: Discuz
does not work

Maybe you didn't add question and answer in activate the module correctly...

Here is example you need to do after you modified those files
- Login to your Question and Answer manager and add new question and answer like this

If you don't add correct image and answer then it won't work...
29 225Forum topics : 9Forum replies : 558Forum likes : 116
Information!Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.
DLEStarter Notice!Please note...Every hack and every module will get additional queries from your database and some hacks and some modules may result your server overload, so install only what you "need", remove any hacks and modules from your script when you don't need them, all hacks and modules appears in this website are not guaranteed by DLEStarter Team for your script security and compatibility, please read instruction carefully and use hacks and modules at your own risk...Thank you.