Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About PrinceTaz

  • Rank
    Regular Member

Recent Profile Visitors

1,147 profile views
  1. What if I'm including from multiple directories? Such as includes and templates? Also can you explain what the "render" function is doing?
  2. Also i want to know this. So I made a template file called viewthread_layout.php. Now I want to create the logic file, viewthread.php that is actually going to run everything. How do I link the two? I want to include the viewthread_layout.php inside viewthread.php because when they click the thread, the url will be /viewthread.php but in layout.php, the content will depend on the scripts in viewthread.php. How do I link each other?
  3. Here is my code: <?php define("BASE_URL", "/Forum"); define("ROOT_PATH", $_SERVER["DOCUMENT_ROOT"] . "/Forum/"); But when I use BASE_URL, it doesn't work properly when including things from "includes" and I have to use ROOT_PATH. But when I'm including things in paratheses such as in tags, only BASE_URL works. I don't understand why that works.
  4. What do you mean by absolute path?
  5. Okay so I just finished designing a template and I want to begin coding but I want to separate the logic from the template as per suggestions I've received. Now I have the separate files that are ready to be included, but how can I include it so that it updates globally. What I mean is this for example. In my header.php, I have included "style/navbar.php". Now from the root directory that's fine. The problem comes when let's say I'm working inside viewpost.php that is actually inside /style and that file includes header.php which includes style/navbar.php. So now viewpost is looking for style/style.php. How do I make php know where the include files are globally and update that directory for each query? I hope I explained this properly.
  6. So I should just do it manually using padding percentages? On the blue box to center it? https://taziamoma.com/Forum/ That is where it's uploaded.
  7. Ah okay I see what you mean. So the blue border was only added so I could show you guys what needed to be centered, it won't be there for the live copy. Once the blue box is centered inside the white parent box, I'll vertically center the content inside the blue box as well. The gray parent box below it will act the same way, the only difference is the shading of the parent background. Essentially, it's a forum layout.
  8. Wow, I never thought of it like that. I've always wondered why big websites don't have that feature, I always thought it was because it would be too complicated to attempt.
  9. Ah okay thank you! Now would it be smart to move the middle area to another file as well? Like header, middle content, and then footer? Then index.php would just be three include files?
  10. Well the blue box would be the child and the white is the parent. Now the parent is inside a container which needs to auto increase in height depending on how many of the parent loop through it.
  11. So I'm posting this in CSS because I think I'm having a CSS issue. Basically, I have this right now: I'm trying to vertically center the blue box and everything inside it. I've tried line-height, vertical-align, display: inline-block, position relative and absolute. The only way that works is if I do it manually with absolute or margin. But absolute isn't responsive so that's a problem. I'm using Bootstrap from the CDN if that matters. I'm only going to include code for the first box so that it doesn't get messy. HTML: <div class="container category-forums clearfix"> <div class="container category-forums-wrap"> <div class="container category-icon clearfix"></div> <div class="container forum-details-wrapper clearfix"> <div class="container forum-details-container"> <p class="forum-name">News Center</p> <p class="forum-desc">Stay up to date with all the latest news and, more importantly, familiarize yourself with the rules.</p> <div class="sub-forum-container container clearfix"> <p class="sub-forums clearfix">Sub-Category 1</p> <p class="sub-forums clearfix">Sub-Category 2</p> <p class="sub-forums clearfix">Sub-Category 3</p> </div> </div> </div> <div class="container forum-threads clearfix"> <h4>108</h4> <p>Threads</p> </div> <div class="container forum-posts clearfix"> <h4>2000</h4> <p>Posts</p> </div> <div class="container forum-latest-posts clearfix"> <div class="container last-avatar clearfix"></div> <p>Lastest thread</p> <p>Yesterday 3:15pm</p> </div> </div> </div> CSS: .category-forums { width: 100%; height: 41%; background-color: #ecf0f1; padding: 0; border-bottom-left-radius:.25rem!important; border-bottom-right-radius:.25rem!important; } .category-icon { width: 7%; height: 100%; border-right: 1px dotted lightgray; margin: 0; float: left; line-height: 100%; } .category-forums-wrap { height: 70%; width: 100%; border: 1px dotted blue; padding: 0; display: inline-block; vertical-align: middle; } .forum-details-wrapper { width: 55%; height: 100%; border-right: 1px dotted lightgray; margin: 0; float: left; padding: 0; } .forum-details-container { width: 100%; height: 100%; border: 1px dotted gray; margin: 0; } .forum-name { margin: 0; } .sub-forum-container { width: 100%; float: left; margin: 0; } .sub-forums { width: 31%; margin: 0; float: left; } .forum-desc { margin: 0; font-size: 1.3rem; } .forum-threads { width: 9%; height: 100%; border-right: 1px dotted lightgray; float: left; text-align: center; line-height: 100%; } .forum-posts { width: 9%; height: 100%; border-right: 1px dotted lightgray; float: left; line-height: 100%; } .forum-latest-posts { width: 20%; height: 100%; float: left; } .last-avatar { width: 25%; height: 100%; border-right: 1px dotted lightgray; float: left; text-align: center; line-height: 100%; } I'm having a tough time even centering the text vertically.
  12. A better question would have been, do I create an elseif but with "$row[''email"] > 0"?
  13. Okay awesome, thank you! Okay I'll keep that in mind. I'll switch to require_once(). Also, by separation of files, you're referring to moving things like the header html to a separate file and just including it? Or should I require it? I understand "templates" but what do you mean by views? Also, I normally indent to know what is nested into each other and I normally just press the tab key. Should I just use the space bar or just not indent as much? I appreciate you for your honesty and your criticism
  14. What do you mean by outputing internal system errors? Also what do you mean by creating variables for nothing. The "root" is just dummy data I used when I uploaded. What should I use instead of INSERT? Also, by not deleting the code, how do you manage it being getting so large?
  15. It's a SQL query which selects an argument to check against the same argument value in the database to check if they are the same?
  • 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.