Jump to content

ds111

Members
  • Posts

    112
  • Joined

  • Last visited

    Never

Everything posted by ds111

  1. your the one that makes up all of this...your posts dont even make sense. seriously, that makes no sense learn to make cohesive sentences and points. thanks
  2. Hey, If anyone could check out a CMS i maintain in my spare time, im currently in a public beta 1 release. So if you could, if you want, download it and install it on your server and check it out and tell me what you think, thats greatly appreciated. The Link is: http://www.mzbservices.com The first post has details about the first beta release. I look forward to hearing your feedback, and thanks so much for taking the time to look at my CMS!
  3. the whole point of smarty is to seperate PHP and HTML first, you need to assign $page and $basename so do something like: $smarty -> assign ('page', basename($_SERVER['SCRIPT_NAME']) ); Don't put that in ur template, put it right before you $smarty -> display the template, okay? Then in the template, put: {if $page == 'index.php'} class="active" {/if} Hope that helps!
  4. Hi, I'm very new to RSS so was trying to get it to work into my content management system. Here's what i have: <? class RSS { public function GetFeed() { return $this->getDetails(); } private function dbConnect() { DEFINE ('LINK', mysql_connect (DB_HOST, DB_USER, DB_PASSWORD)); } private function getDetails() { $detailsTable = "posts"; require_once ('registry/functions/function.connect_db.php'); connect_db (); $query = "SELECT * FROM ". $detailsTable; $result = mysql_query ($query); while($row = mysql_fetch_array($result)) { $link = 'http://localhost/Max.Blog v2.0/index.php?act=showpost&id='.$row['id']; $details = '<?xml version="1.0" encoding="utf-8" ?> <rss version="2.0"> <channel> <title>'. $row['title'] .'</title> <link>'. $link .'</link> <description>'. $row['shortpost'] .''.$row['fullpost'].'</description> </channel> <item> <title>'. $row["title"] .'</title> <link>'. $link .'</link> <description><![CDATA['. $row["shortpost"] .']]></description> </item> '; } $details .= '</channel> </rss>'; return $details; } private function getItems() { /*$itemsTable = "webref_rss_items"; $this->dbConnect($itemsTable); $query = "SELECT * FROM ". $itemsTable; $result = mysql_db_query (DB_NAME, $query, LINK); $items = ''; while($row = mysql_fetch_array($result)) { $items .= '<item> <title>'. $row["title"] .'</title> <link>'. $row["link"] .'</link> <description><![CDATA['. $row["description"] .']]></description> </item>'; } $items .= '</channel> </rss>'; */ // return $items; } } ?> thats the class and for rss.php: <? header("Content-Type: application/xml; charset=ISO-8859-1"); include("registry/classes/class.rss.php"); $rss = new RSS(); echo $rss->GetFeed(); ?> This results in: XML Parsing Error: not well-formed Location: http://localhost/Max.Blog%20v2.0/rss.php Line Number 5, Column 69: <link>http://localhost/Max.Blog v2.0/index.php?act=showpost&id=7</link> --------------------------------------------------------------------------------------------------------------^ Can anyone help? Thanks!!
  5. Hello! I am Ben, the developer of Max.Blog, website is: http://www.mzbservices.com. Max.Blog is a very easy-to-use, user-friendly, blog software. I am currently developing a brand new version, Max.Blog v2.0. It's completely rewritten -- its now OOP-based, has tons of new features, and really cool stuff. What I need is about 10-15 beta testers. You can PM me with your MSN or Yahoo! Messenger account and I will add you and then will tell you the URL to the beta testing site. Once beta tester, you will have access to the site 24/7 and will be an admin. This means you will get to test all features! In addition, if you submit bug reports, suggestions, and basically, well, do your job well, I will add you to the credits when Max.Blog v2.0 is released. Note: At the time of writing, Max.Blog v2.0 isn't even at "Beta" stage. The blog front-end is more or less complete, a few things on my to-do list here and there, and then I will begin the Admin Control Panel. Once at "Release Candidate" stage, the code will be released for you to download. You can then take a look around it and make adjustments, make sure there are no vulnerabilities, etc, and hand in your "improved" version to me. Total time for beta test: ~ 2 months. So yeah, if you are interested, please PM me!
  6. this is part of a content management system. im defining the path by using the base_url that i have set up (its the http url to their website) and a /db_text.txt. i will take a look at that program. thanks! Edit: Oh, that program looks like its a GUI program to be downloaded and installed on the computer. Not good. I need it in PHP.
  7. Hey, Can anyone please show me a PHP script that backs up a database without using the system command mysqldump? I need table structure as well as the table data. Edit: Looks like i can do this with: SELECT * INTO OUTFILE ..... but when i do that it throws out error: #1 - Can't create/write to file '/Library/Application Support/living-e/MAMP PRO/db/mysql/http:/localhost:8888/v2.0/db_backups/dbtest.txt' (Errcode: 2) how do i make it so that it is an absolute path? so that it doesn't have the library/application.... in front of it? Thanks! Thanks! Ben
  8. yup there was margins. fixed. thanks!
  9. hilarious u would say that because when i refreshed the page with the output buffers, i got cascading errors. then i did a "exit;" after my error handler function and that fixed it...still funny how u called it
  10. well actually what i was thinking was... ob_start(); //All the php code if(!isset($query)) { /* An example of a real error handling i have */ $this->handle("query_fail"); } // Code of query_fail: ob_end_clean(); ob_start(); echo "Query failed..."; ob_flush(); Would that work? Edit: tried it on site, yes it does! WAHOO!
  11. alright then how do i do that? use ob_start(); at the beginning that at the end say ob_get_contents(); ?? and that way i can put all the errors and stuff at the beginning?
  12. hmm well the second one made it completely blank but it takes u of the site to a generic blank page, so i cant put any error there.... the first one, erm, sorta works? but i get this however: and document.write not work after that. Code i am using in function: <script> document.body.innerHTML=""; document.write("<?php echo $error; ?>"); </script>
  13. So basically If i have a runtime script (which means it gets executed as it goes) and it outputs a bit of html and stuff but then reaches an error. I want it to clear the screen, make it completely blank and echo the html with the error. Is this possible with document.write? Or should i use something in php? die() basically does the trick but what happens is that it just stops the script for executing further, wich means everything that was already outputted is still there, and it looks like a terribly broken design because the rest of code isnt there.... any way to do this in php or javascript? thanks so much!
  14. uh, duh!! why didnt i think of that.... well, i've got one last problem. So basically theres this wierd space between a hard-coded "test" and a dynamic "test" where the posts are... take a look at screenshot and the code is: test <--- this is the first "test" u see <div class="post"> <a href="http://localhost/showpost/33/0.html"><img src="http://localhost/images/go.png" border="0" title="Full Post"></a> <span style="font-size: 19px; font-weight: bold; color: black;" id="editme33">test</span> <-- this is the bold test u see
  15. It should be a very quick solution but has got me puzzled. The follow code: <nobr> <p> <a href="http://localhost/showpost/33/0.html"><img src="http://localhost/images/go.png" border="0" title="Full Post"></a> <span id="editme33"><h3> test </h3></span> </p> </nobr> Should output [Go image] Test But instead it outputs [Go image] Test Like shown in this screenshot. I've tried <p> tags <nobr> tags, but still it gives that. Ya i know <nobr> is deprecated, but white-space: nowrap doesnt work either...
  16. well for one, you do not use SEO-friendly URLs. Wherever i navigate it still shows as openblog.org . that'll make it extremely hard for Google and Yahoo and other search engines to index your site. i havent registered so cant tell ya how good it is inside, but looks pretty good
  17. anyone else know? please, this is quite urgent
  18. sorry but that was not the problem. for some reason, it was left behind when i posted the message. its a programming challenge, not a human error.
  19. hmm, still having this problem.... anyone know?
  20. yes of course here: change : echo '<option value="'.$row['ROW'].'">'.$row['ROW'].'"</option>'; // Loops and makes the selections to: echo '<option value="'.$row['ROW'].'">'.$row['ROW'].'</option>'; // Loops and makes the selections sorry about that.
  21. code for that would be: <?php connect_db(); //or other db connection here $query = "SELECT * from TABLE WHERE condition"; //edit table, ignore WHERE condition if no condition $run_query =mysql_query($query); //run the query; $selected = $row['selected']; //Change to get value of which one is selected echo '<select name="name" id="id">'; //Start the select. Edit to ur desire while($row = mysql_fetch_array($run_query)) { if($selected == $row['ROW']) { echo '<option selected="selected" value="'.$row['ROW'].'">'.$row['ROW'].'"</option>'; // Loops and makes the selections } else { echo '<option value="'.$row['ROW'].'">'.$row['ROW'].'"</option>'; // Loops and makes the selections } } ^^ That is all for looping and getting selected one from DB. Make sure u edit "ROW", $selected, and insert DB details. Good luck
  22. Hey everyone Ok so I have a little problem. I am allowing my users on the site to edit the sidebar and have variables like: {module.loginform} {module.username} {module.sitename} etc, etc. In the SQL Database, the code is there for each of them. When they submit the sidebar to the server, it saves it. It usually ends up being something like: Welcome {module.username} to {module.sitename}! I've made a little script that searchs in the database then takes the {modules} and replaces the code for them in the sidebar. So in the end it SHOULD look like: Welcome <?php echo $_SESSION['username']; ?> to <?php echo $_SESSION['sitename']; ?>! Which outputs: Welcome, Bob to PHP Freaks! But, instead, it outputs as: Bob Welcome to! Here's all the code related to sidebar: //CODE THAT DOES REPLACING: <?php class modules { function findModules($text) { require_once('registry/loader.php'); $loader = new loader; $loader->load("connect_db", "function"); connect_db(); $query = "SELECT * from modules"; $run_query = mysql_query($query); $num_modules = mysql_num_rows($run_query); // Get the number of modules $i = 0; // The index of how many modules we've replaced so far while($i != $num_modules) { $module_name = mysql_result($run_query, $i, "modname"); // ALWAYS in format: {module.XXXX} Where XXXX is the module name $module_html = mysql_result($run_query, $i, "modhtml"); $module_html = str_replace('<?php', '',$module_html); // Strip Open PHP Tags $module_html = str_replace('<?', '',$module_html); // Strip Open PHP Tags (Other type) $module_html = str_replace('?>', '',$module_html); // Strip Closed PHP Tags $text = str_replace($module_name, $module_html, $text, $count); require_once('registry/functions/function.connect_db.php'); $count = (int)$count; if($count != 0) { $text = str_replace($module_html, eval($module_html), $text); ?> <script> alert("<?php echo $text; ?>"); //For debug purposes </script> <?php } $i++; // Increase amount of modules we've replaced } /* Done with replacing ALL modules recognized :: return the text*/ return $text; } } ?> Code that calls it: require_once('registry/functions/function.connect_db.php'); connect_db(); $query = "SELECT * from sidebar WHERE type='guest'"; $run_query = mysql_query($query); $sidebar = mysql_result($run_query, 0, "html"); require_once('registry/classes/class.modules.php'); $modules = new modules; require_once('templates/'.$_SESSION['skin'].'/sidebar.php'); and in sidebar.php it just has <?php echo $sidebar; ?> embedded in some html code. I hope I've explained it enough. Can anyone help?
  23. Hi! I have my own blog software and for a few features (registration, submitting comments, etc) I want to include reCAPTCHA (found at: http://recaptcha.net) however, this requires every person who uses my blog software to register on their site, get a key, and edit my files. I do not want to inconvenience my users like this, so is there any way to make it so that it doesn't require a key -- or doesn't check for website address? Thanks!
×
×
  • 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.