Author Image in News [RevCMS]

Results 1 to 10 of 10
  1. #1
    Valued Member Muhd Nazmi is offline
    MemberRank
    Dec 2012 Join Date
    Kepler22Location
    107Posts

    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
    Code:
    -{newsAuthor}
    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 :
    Spoiler:


    Thats what I have .
    Attached Thumbnails Attached Thumbnails untitled.png  


  2. #2
    Account Upgraded | Title Enabled! SkeetEmUp is offline
    MemberRank
    Aug 2011 Join Date
    358Posts

    Re: Author Image in News [RevCMS]

    This looks horrible. The big space really makes the article look bad.

  3. #3
    Ask me about Daoism FullmetalPride is offline
    MemberRank
    Nov 2010 Join Date
    2,172Posts

    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.

  4. #4
    Apprentice jontec is offline
    MemberRank
    Feb 2012 Join Date
    6Posts

    Re: Author Image in News [RevCMS]

    Quote Originally Posted by Muhd Nazmi View Post
    I think no one release this then , I would like to release it .


    First : Open {app/tpl/skins/*NAME*/news.php

    Second : Search
    Code:
    -{newsAuthor}
    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 :
    Spoiler:


    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?

  5. #5
    Member TEN-BN is offline
    MemberRank
    Aug 2009 Join Date
    NorwayLocation
    92Posts

    Re: Author Image in News [RevCMS]

    I don't like it, sorry.

  6. #6
    Valued Member Muhd Nazmi is offline
    MemberRank
    Dec 2012 Join Date
    Kepler22Location
    107Posts

    Re: Author Image in News [RevCMS]

    Quote Originally Posted by jontec View Post
    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'}

  7. #7
    Owner of Habbo.ac iRaged is offline
    MemberRank
    Nov 2011 Join Date
    229Posts

    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:


  8. #8
    Run, but I'll find you. Ddos Attack is offline
    MemberRank
    Jan 2011 Join Date
    AustraliaLocation
    908Posts

    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

  9. #9
    Apprentice jontec is offline
    MemberRank
    Feb 2012 Join Date
    6Posts

    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 :(
    Last edited by jontec; 19-12-12 at 04:04 PM.

  10. #10
    topkek amirite?? Leon is offline
    MemberRank
    May 2009 Join Date
    919Posts

    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.



Advertisement