Seite 1 von 5

brauche bitte schnelle hilfe bei Quiz hack

Verfasst: 15.11.2005 23:07
von franticfreak
Hi
kann mir einer das hier einbauen
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$order_sql = ( !isset($post_id) ) ? '' : "GROUP BY p.post_id, t.topic_id, [...]
#
#-----[ AFTER, ADD ]------------------------------------------
#
$count_sql .= ', t.topic_first_post_id, t.topic_quiz'; // ADDED BY Quiz Hack
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, [...]
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
WHERE p.topic_id = $topic_id
$limit_posts_time
AND pt.post_id = p.post_id
AND u.user_id = p.poster_id
ORDER BY p.post_time $post_time_order
LIMIT $start, ".$board_config['posts_per_page'];
#
#-----[ IN-LINE, FIND ]------------------------------------------
#
pt.bbcode_uid
#
#-----[ IN-LINE, AFTER, ADD ]------------------------------------------
#
, pt.quiz_answer
#
#-----[ IN-LINE, FIND ]------------------------------------------
#
ORDER BY p.post_time $post_time_order
#
#-----[ IN-LINE, AFTER, ADD ]------------------------------------------
#
, p.post_id $post_time_order
#
#-----[ AFTER, ADD ]------------------------------------------
#
// ADDED , pt.quiz_answer AND , p.post_id $post_time_order BY Quiz Hack
#
#-----[ FIND ]------------------------------------------
#
$message = str_replace("\n", "\n<br />\n", $message);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// BEGIN Quiz Hack
$quiz_img = '';
$quiz_txt = '';
if ( !empty($forum_topic_data['topic_quiz']) )
{
if ( $postrow[$i]['post_id'] == $forum_topic_data['topic_first_post_id'] )
{
if ( !isset($quiz) )
{
include($phpbb_root_path . 'includes/quiz.'.$phpEx);
}
$message = $quiz->insert_block(QUIZ_QUESTION, $message, $topic_id);
}
else if ( !empty($postrow[$i]['quiz_answer']) )
{
if ( !isset($quiz) )
{
include($phpbb_root_path . 'includes/quiz.'.$phpEx);
}
$message = $quiz->insert_block(QUIZ_ANSWER, $message, $topic_id, $postrow[$i]);
}

if ( $is_auth['auth_mod'] )
{
switch ( $forum_topic_data['topic_quiz'] )
{
case '1':
if ( $postrow[$i]['post_id'] != $forum_topic_data['topic_first_post_id'] )
{
$temp_url = append_sid("quiz.$phpEx?mode=manual_ok&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
$quiz_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_quiz2'] . '" alt="' . $lang['Quiz_answer_manual_ok'] . '" title="' . $lang['Quiz_answer_manual_ok'] . '" border="0" /></a>';
$quiz_txt = '<a href="' . $temp_url . '">' . $lang['Quiz_answer_manual_ok'] . '</a>';
}
break;
case '2':
if ( $postrow[$i]['post_id'] == $forum_topic_data['topic_first_post_id'] )
{
$temp_url = append_sid("quiz.$phpEx?mode=disagree_answer&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
$quiz_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_quiz1'] . '" alt="' . $lang['Quiz_disagree_answer'] . '" title="' . $lang['Quiz_disagree_answer'] . '" border="0" /></a>';
$quiz_txt = '<a href="' . $temp_url . '">' . $lang['Quiz_disagree_answer'] . '</a>';
}
break;
case '3':
if ( $postrow[$i]['post_id'] != $forum_topic_data['topic_first_post_id'] )
{
if ( !isset($quiz) )
{
include($phpbb_root_path . 'includes/quiz.'.$phpEx);
}
if ( empty($quiz->quiz_data) )
{
$quiz->get_quiz_data($topic_id);
}
if ( $postrow[$i]['post_id'] < $quiz->quiz_data['quiz_bot_post_id'] )
{
$temp_url = append_sid("quiz.$phpEx?mode=correct_answer&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
$quiz_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_quiz2'] . '" alt="' . $lang['Quiz_correct_answer'] . '" title="' . $lang['Quiz_correct_answer'] . '" border="0" /></a>';
$quiz_txt = '<a href="' . $temp_url . '">' . $lang['Quiz_correct_answer'] . '</a>';
}
}
break;
}
}
}
// END Quiz Hack
#
#-----[ FIND ]------------------------------------------
#
'DELETE' => $delpost,
#
#-----[ AFTER, ADD ]------------------------------------------
#
// BEGIN Quiz Hack
'QUIZ_IMG' => $quiz_img,
'QUIZ' => $quiz_txt,
// END Quiz Hack


bitte hier rein


http://fallinangel.fa.funpic.de/viewtopic.rar

Ich bekomms nicht hin

bekomme immer diessen fehler
Fatal error: Call to a member function on a non-object in /usr/export/www/vhosts/funnetwork/hosting/fallinangel/includes/classes_cash.php on line 369

Verfasst: 15.11.2005 23:25
von franticfreak
und ausserdem kann ich diesen code hier
#-----[ OPEN ]------------------------------------------
#
/templates/xxx/posting_body.tpl
#
#-----[ FIND ]------------------------------------------
#
formErrors = "{L_EMPTY_MESSAGE}";
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN switch_quiz_answer_js -->
{switch_quiz_answer_js.JS}
<!-- END switch_quiz_answer_js -->
ebenfalls nicht einbauen, weil er die zeile nicht findet


hier meine
---im nächsten beitrag----

Verfasst: 15.11.2005 23:43
von Markus67
Hi ...

das findest du auch nicht in der posting.php sondern in der
/templates/xxx/posting_body.tpl :wink:

Markus

Verfasst: 15.11.2005 23:47
von franticfreak
sorry hatte die falsche datei verlinkt

http://fallinangel.fa.funpic.de/posting_body.rar

hier die richtige

und weist du was mit der anderen datei ist? weist du warum der fehler kommt?

Verfasst: 15.11.2005 23:59
von Markus67
Hi

das in der Posting Body kannst du eigentlich nur weglassen ... die fehlt das komplette Script aus der posting_body.tpl. Das wurde wahrscheinlich durch die BBCode Box entfernt.

Schau mal ob du die Stelle in der mods/bbcode_box/bbcode_box.js findest.

Markus

Verfasst: 16.11.2005 00:05
von franticfreak
Nein gibts nicht
sprich also das die quiz mod dann nicht geht?

wie siehts aus mit der viewtopic?wärst du so nett und baust mir das ein?immer wenn ich das mache kommt der fehler


edit: die viewtopic die ich hochgeladen habe ist schon die bearbeitete

Verfasst: 16.11.2005 01:18
von Markus67
Hi ...

suche in der viewtopic.php

Code: Alles auswählen

$order_sql = ( empty($post_id) ) ? '' : "GROUP BY p.post_id, t.topic_id,$count_sql .= ', t.topic_first_post_id, t.topic_quiz'; // ADDED BY Quiz Hack t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC";
ersetze mit:

Code: Alles auswählen

$order_sql = ( empty($post_id) ) ? '' : "GROUP BY p.post_id, t.topic_id,t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC";
$count_sql .= ', t.topic_first_post_id, t.topic_quiz'; // ADDED BY Quiz Hack
suche:

Code: Alles auswählen

	ORDER BY p.post_time $post_time_order, p.post_id $post_time_order
	LIMIT $start, ".$board_config['posts_per_page'];// ADDED , pt.quiz_answer AND , p.post_id $post_time_order BY Quiz Hack$cm_viewtopic->generate_columns($template,$forum_id,$sql);
if ( !($result = $db->sql_query($sql)) )
ersetze mit:

Code: Alles auswählen

	ORDER BY p.post_time $post_time_order, p.post_id $post_time_order
	LIMIT $start, ".$board_config['posts_per_page'];
$cm_viewtopic->generate_columns($template,$forum_id,$sql);
if ( !($result = $db->sql_query($sql)) )
suche:

Code: Alles auswählen

		'DELETE' => $delpost,		// BEGIN Quiz Hack
		'QUIZ_IMG' => $quiz_img,
		'QUIZ' => $quiz_txt,
		// END Quiz Hack    'ITEMSNAME' => $usernameurl,
    'ITEMS' => $user_items,
ersetze mit:

Code: Alles auswählen

		'DELETE' => $delpost,		
		// BEGIN Quiz Hack
		'QUIZ_IMG' => $quiz_img,
		'QUIZ' => $quiz_txt,
		// END Quiz Hack
		'ITEMSNAME' => $usernameurl,
    		'ITEMS' => $user_items,
Markus

Verfasst: 16.11.2005 01:27
von franticfreak
Nun kommt wenn ich auf "post replay" klicke der fehler hier
Es existiert kein solcher Beitrag. Versuch es noch einmal
Was den nun los?

Verfasst: 16.11.2005 01:37
von Markus67
Hi ...

Dann wird wohl noch ein Fehler in der posting.php sein.
Verlinke die auch mal.

Markus

Verfasst: 16.11.2005 01:42
von franticfreak
http://fallinangel.fa.funpic.de/posting.rar


Und danke schonmal
und ne frage hab ich auch,wo wird den dann die frage/en angezeigt?