Pagina 1 van 1

Edit Post Date

Geplaatst: 11 feb 2005, 20:47
door Alpha
Heeyz,
Ik zet de Edit Post Date mod erin... Nu heb ik gedaan wat er stond en krijg ik deze fout als ik de Post Date wil veranderen... :

Code: Selecteer alles

Could not query Posts table.

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near '' at line 1

SELECT post_time FROM phpbb_posts WHERE post_id = 

Line : 48
File : /var/www/html/forum/includes/edit_post_date.php

en dit is de mod:

Code: Selecteer alles

############################################################## 
## MOD Title: 		Edit Post Date 
## MOD Version: 	1.0.2 
## Author: 		ErDrRon < ErDrRon@aol.com > 
## Description:	 	Allows forum administrators, via an additional button on the Post entitled
##				'date', to change the Post Date of the Post.
## 
## Installation Level:	easy 
## Installation Time:	2 minutes
##
## Files To Edit (2):	viewtopic.php
##				/templates/subSilver/viewtopic_body.tpl
##
## Included Files (7):	edit_post_date_install.txt
##				edit_post_date.php
##				edit_post_date_functions.php
##				edit_post_date_body.tpl
##				lang_edit_post_date.php
##				edit_post_date_icon.gif
##				icon_edit_date.gif
##
############################################################## 
## This MOD is released under the GPL License. 
## Intellectual Property is retained by the MOD Author(s) listed above
##
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ 
##
############################################################## 
## Authors Notes:
##	This function is currently only available to Admins.  Once the function is added a new button
##		entitled 'date' will be available to Admins that, when pressed, allows the changing of
#		the Posting Date of the Post.
##
## Plans for new features:
##	Control panel plug-in that extends us of this function to Moderators or
##		other groups at the desire of the board Admin(s).
##
##############################################################
## Revision History:
##
## v1.0.2 12/08/2002
##	- correction of installation text to include missed items
##	- inclusion of forgotten icon_edit_date.gif (Thanx, Bummer)
##
## v1.0.1 12/07/2002
##	- correction of installation text to include missed items in the initial release (Thanx, Acid)
##
## v1.0.0	12/07/2002
##  - initial Release
##
############################################################## 
## BEFORE ADDING THIS MOD TO YOUR FORUM, YOU SHOULD BACK UP ALL FILES CHANGED BY THE MOD 
############################################################## 

# 
#-----[ COPY ]--------------------------------------- 
# 
copy edit_post_date.php to /includes/edit_post_date.php
copy edit_post_date_functions.php to /includes/edit_post_date_functions.php
copy edit_post_date_body.tpl to /templates/subSilver/edit_post_date_body.tpl
copy lang_edit_post_date.php to /language/lang_english/lang_edit_post_date.php
copy edit_post_date_icon.gif to /templates/subSilver/images/edit_post_date_icon.gif
copy icon_edit_date.gif to /templates/subSilver/images/lang_english/icon_edit_date.gif

# 
#-----[ OPEN ]-------------------------------------------- 
# 
viewtopic.php

# 
#-----[ FIND ]-------------------------------------------- 
# -around line 959-
#
	$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';

# 
#-----[ AFTER, ADD ]------------------------------------
#
// Edit Post Date hack
//
	if ( $userdata['user_level'] == '1' )
	{
		$edit_post_date_id = $postrow[$i]['post_id'];
		$temp_url =  "javascript:window.open('includes/edit_post_date.php?p=$edit_post_date_id','edit_post_date','width=500,height=430');void(0);";
		$edit_date_img = '<a href="' . $temp_url . '"><img src="'  . $images['icon_edit_date'] . '" alt="' . $lang['Edit_post_date'] . '" title="' . $lang['Edit_post_date'] . '" border="0" /></a>';
	}
	else
	{
		$edit_date_img = '';
		$edit_date = '';
	}

// End Edit Post Date hack

# 
#-----[ FIND ]-------------------------------------------- 
# -around line 1246-
#
		'EDIT' => $edit,

# 
#-----[ AFTER, ADD ]------------------------------------
#
		'EDIT_DATE_IMG' => $edit_date_img,

# 
#-----[ OPEN ]--------------------------------------------- 
# 
/templates/subSilver/subSilver.cfg

# 
#-----[ FIND ]--------------------------------------------
# -around line 25-
#
$images['icon_edit'] = "$current_template_images/{LANG}/icon_edit.gif";

# 
#-----[ AFTER, ADD ]------------------------------------
#
$images['icon_edit_date'] = "$current_template_images/{LANG}/icon_edit_date.gif";

# 
#-----[ OPEN ]--------------------------------------------- 
# 
/templates/subSilver/viewtopic_body_tpl.php

# 
#-----[ FIND ]--------------------------------------------
# -around line 37-
#
				<td valign="top" align="right" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>

# 
#-----[ IN-LINE, FIND ]-----------------------------------
#
{postrow.EDIT_IMG}

# 
#-----[ IN-LINE AFTER, ADD ]----------------------------
# -Note there is a space at the beginning of the following bit of code-
#
 {postrow.EDIT_DATE_IMG}

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
Greetz

Geplaatst: 12 feb 2005, 00:08
door djrandall
open edit_post_date.php
zoek:

Code: Selecteer alles

		$sql = "SELECT post_time" .
 				" FROM ". POSTS_TABLE .
				" WHERE post_id = $p";
vervang door:

Code: Selecteer alles

		$p = htmlspecialchars($_GET['p']);
		$sql = "SELECT post_time" .
 				" FROM ". POSTS_TABLE .
				" WHERE post_id = $p";

Geplaatst: 12 feb 2005, 00:16
door Alpha
:shock: :shock: :shock: geweldig man! :thumb: thnx :thumb:

Geplaatst: 12 feb 2005, 13:07
door Paul
djrandall schreef:open edit_post_date.php
zoek:

Code: Selecteer alles

		$sql = "SELECT post_time" .
 				" FROM ". POSTS_TABLE .
				" WHERE post_id = $p";
vervang door:

Code: Selecteer alles

		$p = $_GET['p'];
		$sql = "SELECT post_time" .
 				" FROM ". POSTS_TABLE .
				" WHERE post_id = $p";
Dit is best gevaarlijk voor sql injection. Je zou het toch door htmlspecialchars(); moeten halen om het veiliger te maken.

Geplaatst: 12 feb 2005, 18:57
door djrandall
UPDATE VORIGE POST.

Je hebt gelijk is idd veiliger zo!

volgende vraag

Geplaatst: 21 mar 2005, 16:52
door spydi
ten eerst bedankt tot zo ver al voor de hulp , maar nu het volgende als ik de datum wil veranderen geeft hij steends aan " That is an invalid date! "
hoe kan ik dit oplossen?

Geplaatst: 22 mar 2005, 19:17
door Alpha
sorry voor me late reactie, dit topic was beetje afgezakt...

maar ik heb idd precies hetzelfde wat []ispydi[/i] zegt...

en over die SQL wat je zegt... ik heb dat vorige nou al gedaan? hoe kan ik dat weer veranderen?

Geplaatst: 23 mar 2005, 19:33
door spydi
Ik krijg die post edit niet goed maar heb nu een andere mod waarmee ik de topic`s kan verplaatsen , omhoog en omlaag dus nu kan ik ze op volgorde zetten en dat was wat ik wou dus ik ben klaar. :D

Geplaatst: 28 mar 2005, 12:32
door Muiter
spydi schreef:ten eerst bedankt tot zo ver al voor de hulp , maar nu het volgende als ik de datum wil veranderen geeft hij steends aan " That is an invalid date! "
hoe kan ik dit oplossen?
Same here :(

Hij geeft ook een probleem met de 'Topic Preview' mod.

Code: Selecteer alles

Could not query preview information

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near '' at line 3

SELECT post_text, bbcode_uid, enable_smilies FROM phpbb_posts_text AS pt, phpbb_posts WHERE pt.post_id=

Line : 38
File : functions.php

Code: Selecteer alles

// Begin Topic Preview
function get_preview_text($post_id, $length)
{
	global $db, $board_config;

	$sql = "SELECT post_text, bbcode_uid, enable_smilies
		FROM " .POSTS_TEXT_TABLE ." AS pt, " . POSTS_TABLE ."
		WHERE pt.post_id=$post_id";

	//
	// query the database
	//
	if(!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not query preview information', '', __LINE__, __FILE__, $sql);
	}

Geplaatst: 31 mar 2005, 19:06
door Alpha
* bump *

Geplaatst: 01 apr 2005, 18:22
door Muiter
Muiter schreef:Hij geeft ook een probleem met de 'Topic Preview' mod.
Iemand een idee? Ik de wijziging ongedaan gemaakt maar blijf ik dezelfde foutmelding houden.

Geplaatst: 03 apr 2005, 07:52
door Muiter
Op welke manier kan ik de data in de database veranderen? Dit is ook te doen omdat het maar zelden voor komt.

Geplaatst: 30 apr 2005, 13:41
door Alpha
:roll: