1 Attachment(s)
Author Image in News [RevCMS]
I think no one release this then , I would like to release it .
First : Open {app/tpl/skins/*NAME*/news.php
Second : Search Third : Replace that with
Code:
<style>
img.floatRight {
float: right;
margin: 4px;
}
h3 {text-align:right; margin:10px;}
</style>
<h3>-{newsAuthor}</h3>
<?php
$getCom = mysql_query("SELECT * FROM cms_news WHERE id = '".htmlentities($_GET['id'])."' ");
?><?php
while($Com = mysql_fetch_array($getCom)){
$getuserlook = mysql_query("SELECT * FROM users WHERE username = '".$Com['author']."'");
$userlook = mysql_fetch_array($getuserlook);
echo'
<img src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$userlook['look'].'&direction=2&head_direction=3&size=m" class="floatRight">
';
}?>
Screenies :
Thats what I have .
Re: Author Image in News [RevCMS]
This looks horrible. The big space really makes the article look bad.
Re: Author Image in News [RevCMS]
It's decent.
But, I think you need to close your hotel based on that article.
"Based on my statistic."
"These are my last words"
And they won a badge for being the most active user?
I lol'd.
Re: Author Image in News [RevCMS]
Quote:
Originally Posted by
Muhd Nazmi
I think no one release this then , I would like to release it .
First : Open {app/tpl/skins/*NAME*/news.php
Second : Search
Third : Replace that with
Code:
<style>
img.floatRight {
float: right;
margin: 4px;
}
h3 {text-align:right; margin:10px;}
</style>
<h3>-{newsAuthor}</h3>
<?php
$getCom = mysql_query("SELECT * FROM cms_news WHERE id = '".htmlentities($_GET['id'])."' ");
?><?php
while($Com = mysql_fetch_array($getCom)){
$getuserlook = mysql_query("SELECT * FROM users WHERE username = '".$Com['author']."'");
$userlook = mysql_fetch_array($getuserlook);
echo'
<img src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$userlook['look'].'&direction=2&head_direction=3&size=m" class="floatRight">
';
}?>
Screenies :
Thats what I have .
Awesome! But I have a problem; the {newsAuthor} code just gives me a number like:
News text
- 3
How to fix this?
Re: Author Image in News [RevCMS]
Re: Author Image in News [RevCMS]
Quote:
Originally Posted by
jontec
Awesome! But I have a problem; the {newsAuthor} code just gives me a number like:
News text
- 3
How to fix this?
Run this SQL - {ALTER TABLE `cms_news` CHANGE `author` `author` VARCHAR( 6 ) NOT NULL DEFAULT '1'}
Re: Author Image in News [RevCMS]
I suggest that you improve this and add a little more CSS styles to it. As you can see, I have the head of the avatar as well as rank and motto on my news:
http://snag.gy/0wyoz.jpg
Re: Author Image in News [RevCMS]
You could simply do style="float:right;" to the image so that it floats to the right of the text and stops that big blank space ;P
Re: Author Image in News [RevCMS]
This is the code... If you want style, do it yourself, like Im'a do
This is what I needed
Thnx!
And the SQL didn't work :(
Re: Author Image in News [RevCMS]
Can I suggest, when you ever put the ID of something in a query, you parse it as an integer. The code you currently have really isn't secure. Use
PHP Code:
$id = intval($_GET['id']);
And then put $id in the query instead of just htmlentities($_GET['id']), which isn't secure.
Or just sack using mysql_* functions and use PDO and prepared statements.