Jump to content

Julius

Members
  • Posts

    62
  • Joined

  • Last visited

    Never

Everything posted by Julius

  1. <div class="wrapper"> <section> <article> <header> <h1><a href="#">Some random photo</a></h1> </header> <div class="wrap-image"> <img src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/267534_10150175822712255_172774152254_6000657_5021105_n.jpg" alt="*" /> </div> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.</p> <p>Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p> <a href="#" class="more">Read more ยป</a> </article> </section> </div> img tag in .css .wrapper article .wrap-image { float: left; padding-right: 20px; width: 450px; height: 300px; margin-top: 10px; margin-bottom: 10px; } .wrapper article .wrap-image img, .wrapper article .image img { max-width:100%; max-height:100%; padding: 5px; background-color: #fff; border-radius: 3px; }
  2. I have opera with built in dragon fly, I think it does the same as fire bug. Text: .wrapper article p { text-align: justify; font-size: 13px; } I think is because of max-width, dont you think?
  3. .wrapper article .wrap-image { float: left; padding-right: 20px; max-width: 450px; max-height: 300px; margin-top: 10px; margin-bottom: 10px; } But it doesn't work like i want to. It works with this picture: but does not work with this image How can I fix this?
  4. check session ID on different pages: is it different?
  5. Just added position: absolute; and -o-transform: rotate(-5deg); (works for opera only, will work on other browser later).
  6. Hi, I need to rotate text about 30-45 degrees NOT clockwise. How do I do that? .topbar .project_name { text-align: left; margin-left: 20px; } How do I finish this?
  7. $result = mysql_fetch_array($SQL) or die(mysql_error()); You didn't execute query. Replace that line to this $result = mysql_query($SQL) or die(mysql_error()); Also, use <?php ?> instead of <? ?>
  8. What I would do first: check what you have in database (password) and compare it to the one which you are giving in login form. <?php session_start (); $username = @ $_POST['username']; $password = @ $_POST['password']; if($username&&$password) { $connect = mysql_connect ("localhost", "root","") or die ("could not connect"); mysql_select_db ("login") or die ("could not find db"); $query = mysql_query ("SELECT * FROM users WHERE username = '$username'") or die(mysql_error()); $numrows = mysql_num_rows ($query); if ($numrows!= 0) { while ($row = mysql_fetch_assoc($query)) { $dbusername = $row ['username']; $dbpassword = $row ['password']; } if ($username == $dbusername && md5 ($password) == $dbpassword) { echo 'you are in! <a href="member.php">click here</a> to go to member page.'; $_SESSION['username'] = $username; } else { echo 'Values: username: ' . $username . ', dbusername: ' . $dbusername . ', password: ' . md5($password) . ', dbpassword: ' . $dbpassword . '<br/>'; echo 'Sorry incorrect password, try again <a href="index.php"> return to log in page </a>!'; } } else die ("that user doesenยดt exist"); } else die ("Please enter username and password!"); ?> Also: you can replace your query to this $query = mysql_query ("SELECT username FROM users WHERE username = '$username' AND password = '" . md5($password) . "'") or die(mysql_error()); if ( mysql_num_rows ( $query ) == 1 ) { echo 'Success'; } else { echo 'Try again'; } But thats after you find what you were doing wrong
  9. Maybe this will work SELECT * FROM blog_entry LEFT JOIN categories ON categories.CategoryID = blog_entry.CategoryID WHERE blog_entry.UserID=".$_REQUEST['UserID']." GROUP BY blog_entries.CategoryID
  10. Hello, I have this query: SELECT f.forum_name, f.forum_id, t2.topics, p2.posts, users.username FROM forums f LEFT JOIN ( SELECT t.topic_id, t.forum_id, count( t.topic_id ) AS topics FROM topics t GROUP BY t.forum_id )t2 ON t2.forum_id = f.forum_id LEFT JOIN ( SELECT p.post_id, count( p.post_id ) AS posts, p.topic_id FROM posts p GROUP BY p.topic_id )p2 ON p2.topic_id = t2.topic_id LEFT JOIN forum_moderators ON forum_moderators.forum_id = f.forum_id LEFT JOIN group_user ON group_user.group_id = forum_moderators.group_id LEFT JOIN users ON users.user_id = group_user.user_id GROUP BY f.forum_position, group_user.group_id, users.username the problem here is that query returns bad count of posts. I tried to remove one subquery, then the other one, then both, then play with group by, but that was useless. Can someone help me with this? I removed few things that are not priority, and one subquery: SELECT f.forum_name, count( topics.topic_id ) AS topics, p2.posts FROM forums f LEFT JOIN topics ON topics.forum_id = f.forum_id LEFT JOIN ( SELECT p.post_id, count( p.post_id ) AS posts, p.topic_id FROM posts p GROUP BY p.topic_id )p2 ON p2.topic_id = topics.topic_id GROUP BY f.forum_position To be clear: there are two topics and 18 posts in one of the forums (in one topic 16, other one 2 posts), query counts that that forum has 2 topics (correct) and 16 posts(incorrect). How do I fix this?
  11. Looks like I found solution. UPDATE forums as f_one, forums as f_two set f_one.forum_position=f_two.forum_position, f_two.forum_position=f_one.forum_position where f_one.forum_id=1 AND f_two.forum_id=2
  12. Hello, I have this table `forums`, in it: forum_id, forum_name, forum_position. SELECT * FROM `forums` 1 Test 1 2 Test_two 2 Now, how can I swap those position numbers? I want 'Test' position to be 2 and 'Test_two' position to be 1. I tried this: UPDATE forums SET forum_position=forum_position-1, forum_position = forum_position+1 WHERE forum_id = 2 AND forum_id = 1 but it didn't work.
  13. Julius

    massive query

    what do you mean? i have heard about 'join', googled for it, found some examples, tried, but they don't do exactly what I want. I dont want you to write the whole query for me, just give me a hint. what i tried: SELECT categories.name, forums.name, topics.name, posts.date, users.nick FROM categories LEFT JOIN (forums, topics, posts, users) ON (forums.cat_id=categories.id AND topics.fid=forums.id AND posts.tid=topics.id AND users.id=posts.author) i think this might do the trick after some modifications, am I thinking right? this query takes only one forum (but there are three of them).
  14. Hi, I have 5 tables: categories id, name forums id, cat_id, name, description topics id, forum_id, name, date, user_id posts id, topic_id, post, date, user_id users id, nick, password im trying to make a forum. on the main page of it, i want to show category name(will be at least 3 categories), forum name and description, latest post in that forum author name and topic name where post was posted. I want to make as less queries as i can. so, can anyone help me with that? I need: name from categories table, name from forums table, name from topics table, latest post user_id from posts table, nick from users table where id=user_id (from posts). can this all be retrieved with one query?
  15. but i have seen quite many articles saying that CSS > tables. are they wrong?
  16. Hi, Can you please help me and write, how should div style look like if i want four columns: first should be wider than others because it will contain forum name and description, second will hold just 3 digits, third will hold about four or five digits, and last will hold just last message author, topic name and date when the last post was added in that forum. Thank you
  17. This is simple, and not flexible. I want more complicated version of this. If I would do like you said, I should: create one level for all forums or create very many levels for those cases when user is moderator of first and second forum, first and third forum, second and third forum, or second third and fourth forums. this is flexibility I need. All I have thought out is to create group_names (id, name for example id 1 name user), and group_members ( group_id, member_id, forum_id). Right? But in this case, if there are twelve forums, and one user is moderator of all if them, there would be twelve entries in group_members with the same group_id and member_id. Right? And if I want to add administrator, then in group_members forum_id field i should put zero or leave it blank, because administrator should be moderator of all forums? I want to do this as good as I can for the first time
  18. done. found nothing exactly what I need or explained in very complicated way. If it's so easy, come on, share your knowledge, please
  19. Hello, I'm creating a website with forum, and till I didn't go too far, I want to make a user levels or something like that. So here it is: i want for example first user to be moderator of first forum; second user would be moderator of first and second forums; I want myself to be an administrator and could be moderator of both of those forums. How should I separate these levels? I hope you understood my problem
  20. bump. please help
  21. If you can't understand what am I asking, just say - I will try to explain better
  22. Hi, I'm trying to write my first MVC framework for my college project and faced this problem: i have main framework class, and have this loader class, that loads view files and libraries. Now, how can I do that when I load library, I could reach it from my main class? For example: in main class goes this code: public $load; function __construct ( ) { $this->load = new Loader; } function someFunction ( ) { $this->load->library('someLibrary'); // and now reach the library like this $this->someLibrary->functionInLibrary(); } The idea is from codeigniter, so if anyone has used this framework will understand my question.
  23. BINGO! Thank you!
  24. I'm pretty new in php oop and mysql. I don't know how to make my function so it could see the difference between select and insert, update, delete queries. <?php class DB { public $results = array ( ); public function query ( $query ) { $qr = mysql_query ( $query ); // now, if this was select query, i want to store results in $this -> results // otherwise do nothing or return true if query succeeded. } } ?>
  25. Hello, I'm trying to make my first database class. I thought I will create a function for select, delete, update and insert, but then I thought, what if I'm going to use join while selecting something? and then I realised, that I need only one function, called query. Now, the issue is that I don't know how to make function know that I'm selecting some data from database, or I'm updating data. If I select data, I want my result variable to be filled with results. I hope you understand my question-problem. I want this to be smart, so if you have any ideas - please share. Thank you
×
×
  • 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.