Jump to content

Julius

Members
  • Posts

    62
  • Joined

  • Last visited

    Never

Everything posted by Julius

  1. Does anyone clean/filter session id? Is it necessary?
  2. One more question: when writing html code, it contains quotes. What to do, when my text contains quotes? It's okay when I write articles alone, but if I let someone else write articles, there might be some trouble, I think
  3. browser cached my css file, so I cleared cache and it started working properly
  4. Hello, Why <img style="float: left; margin-right: 5px; padding: 5px; background-color: white; border-radius: 5px;" src="existing_image_500px_wide.jpg" alt="text" width="400" /> returns what I want, but when I transfer all styling to .img_style { here } and in img tag replace style="..." to class="img_style" it doesn't work at all?
  5. Yeah, I was thinking about bbcode. Any other suggestions are welcome
  6. Hello, I made myself a simple blog system, but in my case "simple" becomes difficult when it comes to writing an article. Have you ever seen that movie about how facebook was created (I think it's called "Social network" or something like that)? As a newbie web developer I noticed how "Mark" was writting his blog post. I think it was an textarea, and when he was writing article, he wrote it with html tags, like <p>. So, I have now the same problem: when I'm writing article, I have to write it with all div's and p's and a's and img's and so on. I want to avoid that. Few ideas did pop to my head: use preg_replace for some elements, and set up some javascript WYSIWYG editor (but i really don't want it, and can't explain why, I just don't like it). I have a couple of css classes for images, both of them resizes images, one resizes it a lot, other not so much, both make them smaller. One class is for image to be on the left, so the text would wap that image from the right. After paragraph I must clear floats with css class. Other image class just takes full width available and if image is bigger that that available width - it resizes image. So no need to clear floats. How can I make my life easier when I'm writing article to my blog?
  7. I guess you didn't understand my problem. Yes, I did run that method. It gives me an error because of that variable (not defined). How can I reach it? I know that in codeigniter's view file you can just type echo $this -> var; or something like that, and the variable value is shown
  8. Hi, I'm trying to write myself a tiny MVC framework and having some trouble: <?php class One { public function main ( ) { $var = 'Hello'; include ( 'file.php' ); } } ?> file.php: <?php echo $var; ?> This doesn't work. Is there any way without setting that variable to global, to reach it like that?
  9. Thank you very much for your help
  10. I was playing around with this pattern for about an hour, and the thing that I did wrong was adding slash right before ], not after ^. But what works faster: :alnum: or all given values? or it doesn't really matter in this case? Thank you for your help, guys!
  11. Heres what I have so far: $url = str_replace ( "/index.php/", "", $_SERVER [ 'REQUEST_URI' ] ); $url = preg_replace('#([^A-Za-z0-9_-])#', '', $url); echo $url; I want to replace EVERYTHING in my url EXCEPT a-zA-Z0-9_- and forward slash. How can I escape forward slash in my pattern?
  12. Well, I think I fixed it. I just moved anchor inside span. Removed margin, added some padding here and there and there it is. Will have to get back to this, because when I zoom in, sizes of span and those icons padding appears to be different while when zoom is set to 100%, i can't see any difference.
  13. Well, now elements are in the same line, but everything looks crappy now. Images are 16x16px, I added some padding (red color) so that the element would be bigger and clearly visible. But now: 1. Somethings wrong with padding, I just wanted it to be about 5px outside icon in all directions, but when display was set to block, 13px of padding gave me what I wanted 2. How can I put that element that is on the spans left (that icon with padding) to be on spans left, like it is in the first attached file? Thanks for helping me out EDIT: .icon { background-color: red; background-repeat: no-repeat; background-position: center center; padding: 1px 15px 5px 15px; margin-right: 5px; } take a look at the padding. It gives me pretty much what I want (like in first attached file), but why the numbers are so strange?
  14. heres the html <div class="grid_12 topbar"> <div class="fl brand"> <h1><a href="#">Testas</a></h1> </div> <div class="fr user-menu"> <ul> <li> <a href="#" class="round icon ic-user"></a> <span class="mini-info">Welcome, Julius</span> </li> <li><a href="#" class="round icon ic-settings"></a></li> <li><a href="#" class="round icon ic-messages"></a></li> <li><a href="#" class="round icon ic-logout"></a></li> </ul> <div class="clear"></div> </div> <div class="clear"></div> </div> <div class="clear"></div> <!-- TOP BAR END --> CSS .grid_12 { float: left; width: 940px; } .grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6, .grid_7, .grid_8, .grid_9, .grid_10, .grid_11, .grid_12 { margin: 0 10px; } .topbar { height: 60px; background-color: #fff; } .fl { float: left; } .fr { float: right; } .user-menu ul { list-style-type: none; } .user-menu li a { display: block; float: left; } .round { border-radius: 5px; } .icon { background-color: red; background-repeat: no-repeat; background-position: center; padding: 13px; margin-right: 5px; } .ic-user { background-image: url('../images/icons/ic_user.png'); } .ic-settings { background-image: url('../images/icons/ic_settings.png'); } .ic-messages { background-image: url('../images/icons/ic_mail.png'); } .ic-logout { background-image: url('../images/icons/ic_cancel.png'); } .mini-info { display: block; margin: 0px; background-color: black; font-size: 12px; color: white; padding: 4px; border-radius: 7px 5px 5px 7px; } display: block; gives me no space between those two elements, and that is what I want, so if we will fix this issue with span and there will be a gap between those two elements, I hope you will help me merging them again, like it is now
  15. Didn't help. I tried in .mini-info set display to inline, inline-block, same did to li a, nothing. It still causes a new line after it
  16. Look at the attached picture to see whats wrong. Markup: <div class="fr user-menu"> <ul> <li><a href="#" class="round icon ic-user"></a><span class="mini-info">Welcome, Julius</span></li> <li><a href="#" class="round icon ic-settings"></a></li> <li><a href="#" class="round icon ic-messages"></a></li> <li><a href="#" class="round icon ic-logout"></a></li> </ul> <div class="clear"></div> </div> CSS .fr { float: right; } .mini-info { display: block; margin: 0px; background-color: black; font-size: 12px; color: white; padding: 4px; border-radius: 7px 5px 5px 7px; } .user-menu ul { list-style-type: none; } .user-menu li a { display: block; float: left; } other classes (round, icon, ic-*) I think has nothing to do with it since they just have some padding and background image attributes. So how can I force other elements after span to be in same line as span is?
  17. Solved. I don't know if it's a good practice, but I did a bar at the top, under it i did a div with my content that should be in that bar, and did margin-top: -40px;
  18. Hi, I want to make a topbar, thats width is 100%, but my sites width is only 960 pixels. Topbar should be as wide as users monitor resolution is. And i need to place elements in it in 960 pixels area. How can I do that? I hope you understood my problem
  19. Ok, then other question: that div gives me some more blank space then elsewhere, is it okay if I'll remove it with margin-top: -20px; ? I somehow think, that negative margin in most cases is bad practice
  20. So you wanna say I will have to add that div each time i'll add picture to blog post and theres no easier way to make this more automatic? I mean, I will display posts from database, so I'll have to use some sort of filtering in php, that looks for image? BTW: thank you for your help
  21. It works okay now with both pictures (shown in first post). But because of float: left; I have to use <div style="clear: both; overflow: hidden;"></div>, otherwise link "Read more" gets attached to resized photo bottom. Is there some way to avoid that div and write it in css in some element? Otherwise I will have to check for an image in the article and add the div. Don't get the website name wrong
  22. Link: http://pussymagnet.eu/magnet/ http://pussymagnet.eu/magnet/style.css
  23. So, if I understood you correctly, I did this: .wrapper article .wrap-image { float: left; padding-right: 20px; /*max-width: 450px; */ max-height: 300px; margin-top: 10px; margin-bottom: 10px; } I left everything else like it was. Now the image is not being resized: it's printed in 100% of it's size
  24. So how can I fix this? I'm pretty new to all this stuff, a few weeks only. I want images to be resized, and their maximum size would be 450x300 px. How can i do that?
  25. Still no. HTML: <!DOCTYPE html> <html lang="en"> <head> <title>MyWebsite</title> <meta charset="utf-8" /> <link rel="stylesheet" type="text/css" href="/style.css" /> </head> <body> <div class="topbar"> <div class="project_name">myWEBSite</div> <div class="nav"> <ul> <li><a style="color: rgb(109, 109, 109);" href="#">HOME</a></li> <li><a href="#">BLOG</a></li> <li><a href="#">FORUM</a></li> <li><a href="#">GALLERY</a></li> <li><a href="#">CONTACTS</a></li> </ul> </div> <form class="fields"> <input type="text" name="username" placeholder="Username" /> <input type="password" name="password" placeholder="Password" /> <input type="submit" value="Login" /> <div class="small_links"> <a href="#">Forgot password?</a> <a href="#">Come on, sign up!</a> </div> </form> </div> <div class="wrapper"> <section> <article> <header> <h1><a href="#">Lorem ipsum</a></h1> </header> <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> <article> <header> <h1><a href="#">Some random picture</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> <article> <header> <h1><a href="#">Sexy Supra mk3</a></h1> </header> <div class="image"> <img src="https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/390407_10150570915041079_55370306078_10585510_1103718656_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. 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> <aside> <div class="box"> <div class="title">Box title</div> <div class="content"> Box content goes here </div> </div> </aside> </div> </body> </html> CSS body { margin: 0px; padding: 0px; background-color: rgb(29, 40, 55); font-family: 'Trebuchet MS', Helvetica, sans-serif; color: #ffffff; } .wrapper { width: 960px; margin-left: auto; margin-right: auto; text-align: center; margin-top: 20px; } .wrapper section { width: 700px; float: left; } .wrapper article { border-bottom: 1px solid #242424; } .wrapper article header, .wrapper article header h1 { margin: 0px; padding: 0px; text-align: left; } .wrapper article .wrap-image { float: left; padding-right: 20px; /*width: 450px; 697 */ height: 300px; /* 465 */ margin-top: 10px; margin-bottom: 10px; } .wrapper article .image { width: 690px; /* 450 */ height: 460px; /* 300 */ margin-top: 10px; margin-bottom: -20px; } .wrapper article .wrap-image img, .wrapper article .image img { max-width:100%; max-height:100%; padding: 5px; background-color: #fff; border-radius: 3px; } .wrapper article header a { margin: 0px; color: rgb(109, 109, 109); } .wrapper article a.more { display: block; width: 104px; margin-bottom: 10px; font-size: 12px; background-color: black; color: white; text-decoration: none; } .wrapper article a.more:hover { background-color: #CC2121; } .wrapper article p { text-align: left; font-size: 13px; } aside { width: 260px; float: right; font-size: 15px; } aside .box { width: 200px; margin-left: auto; margin-right: auto; } aside .box .title { padding: 5px; background-color: rgb(109, 109, 109); border: 1px solid rgb(109, 109, 109); border-radius: 5px 5px 0px 0px; } aside .box .content { border-left: 1px solid rgb(109, 109, 109); border-right: 1px solid rgb(109, 109, 109); border-bottom: 1px solid rgb(109, 109, 109); border-radius: 0px 0px 5px 5px; } .topbar { width: 100%; height: 30px; padding-top: 10px; padding-bottom: 10px; text-align: center; background-color: #263347; border-bottom: 1px solid #242424; } .topbar .nav { float: left; margin-left: 200px; } .topbar .nav ul { display: block; margin-top: 3px; } .topbar .nav ul li { list-style-type: none; display: inline; padding: 5px; } .topbar .nav ul li .marked a { color: rgb(109, 109, 109); } .topbar .nav ul li a { text-decoration: none; color: #CC2121; font-weight: bold; } .topbar .project_name { position: absolute; background-color: #1D2837; padding: 3px; color: #CC2121; text-align: left; font-size: 18px; font-weight: bold; margin-left: 20px; border: 1px solid black; -o-transform: rotate(-3deg); border-radius: 3px; } .topbar .fields { float: right; margin-top: 3px; margin-right: 20px; } .topbar .fields .small_links { font-size: 10px; margin-left: 120px; } .topbar .fields .small_links a { text-decoration: none; color: #6D6D6D; } .topbar .fields input { background-color: #371F1D; border: 1px solid black; color: rgb(109, 109, 109); }
×
×
  • 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.