Jump to content

Recommended Posts

Any code examples or anything?

 

Your best using a session checker and a user level, Obviously if the user isnt logged in its going to be NULL so you'll need an IF Statement to check if they are logged in, If there not logged in dont show the buttons

Link to comment
https://forums.phpfreaks.com/topic/131181-article-edit-button/#findComment-681061
Share on other sites

plz check this

 

public function ViewThread($ArtiSub, $ArtiBod) {
	try{	
	$CheckMemList = sprintf("SELECT `artid`, `subject`, `body`, `uid`, `username`, `curtime` FROM %s ORDER BY curtime DESC",
	parent::BHL_CONT_MGM);
	$ArtiList = mysql_query($CheckMemList) or die( mysql_error());
		if(!mysql_num_rows($ArtiList) == 1) {
			echo "";
		}

		if (isset($_GET['Artid'])) {
		$Artid = $_GET['Artid'];
		$sql = sprintf("SELECT `artid`, `subject`, `body`, `uid`, `username`, `curtime` FROM %s WHERE artid='%s'",
		parent::BHL_CONT_MGM, $Artid);
		$Checkq = mysql_query($sql);
		$rowF = mysql_fetch_array($Checkq);
		echo '<table width="500" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#996600" bgcolor="#FFFFFF"><tr>';
		echo '<th scope="col"><div align="center">'.$rowF['subject'].'</div></th></tr></table>';
		echo '<table width="500" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#996600" bgcolor="#FFFFFF"><tr>';
		echo '<th scope="col"><div align="right">'.$rowF['body'].'</div></th></tr></table>';
		echo '<table width="500" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#996600" bgcolor="#FFFFFF"><tr>';
		echo '<th width="165" scope="col"><div align="right"><a href="oper/editarti.php">Edit this article</a></div></th>';
		echo '<th width="160" scope="col"><div align="right">'.$rowF['curtime'].'</div></th>';
		echo '<th width="175" scope="col"><div align="right">'.$rowF['username'].'</div></th></tr></table>';
		echo '<br/>';
		$query = sprintf("SELECT * FROM %s WHERE `artid` = ".$rowF['artid']."",
		parent::BhlDbCommUsersTbl);
		$query2 = mysql_query($query);
		while($Frow = mysql_fetch_array($query2)){
		echo '<table width="500" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#996600" bgcolor="#FFFFFF"><tr>';
		echo '<th scope="col"><div align="center">'.$Frow['subject'].'</div></th></tr></table>';
		echo '<table width="500" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#996600" bgcolor="#FFFFFF"><tr>';
		echo '<th scope="col"><div align="right">'.$Frow['body'].'</div></th></tr></table>';
		echo '<table width="500" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#996600" bgcolor="#FFFFFF"><tr>';
		echo '<th width="165" scope="col"><div align="right"><a href="oper/editcomm.php">Edit this comment</a></div></th>';
		echo '<th width="160" scope="col"><div align="right">'.$Frow['curtime'].'</div></th>';
		echo '<th width="175" scope="col"><div align="right">'.$Frow['username'].'</div></th></tr></table>';
		echo '<br/>';
		}

Link to comment
https://forums.phpfreaks.com/topic/131181-article-edit-button/#findComment-681080
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.