vividona Posted November 3, 2008 Share Posted November 3, 2008 I have a simple funny article script the edit button of the article appear to all members and guests I need it to appear just for the article writer Quote Link to comment https://forums.phpfreaks.com/topic/131181-article-edit-button/ Share on other sites More sharing options...
stublackett Posted November 3, 2008 Share Posted November 3, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/131181-article-edit-button/#findComment-681061 Share on other sites More sharing options...
vividona Posted November 3, 2008 Author Share Posted November 3, 2008 I don't need to show to all member also I neet for the article writer only Quote Link to comment https://forums.phpfreaks.com/topic/131181-article-edit-button/#findComment-681069 Share on other sites More sharing options...
Adam Posted November 3, 2008 Share Posted November 3, 2008 Need to see some code?? Can't help you if we have absoloutley no idea how you're doing it at the minute.. Quote Link to comment https://forums.phpfreaks.com/topic/131181-article-edit-button/#findComment-681073 Share on other sites More sharing options...
vividona Posted November 3, 2008 Author Share Posted November 3, 2008 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/>'; } Quote Link to comment https://forums.phpfreaks.com/topic/131181-article-edit-button/#findComment-681080 Share on other sites More sharing options...
Garethp Posted November 3, 2008 Share Posted November 3, 2008 I can't see anyway, is there a piece of code that states variables that we can see? Quote Link to comment https://forums.phpfreaks.com/topic/131181-article-edit-button/#findComment-681084 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.