PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2456
Location: Pittsburgh, Pennsylvania

PostPosted: Tue Jan 13, 2009 5:46 pm Reply with quote Back to top

jakec, Looks good to me :clap:
View user's profile Send private message
gator81
Worker
Worker


Joined: Jun 09, 2007
Posts: 108

PostPosted: Tue Jan 13, 2009 7:31 pm Reply with quote Back to top

Ty jakec, that did it, it is working now Smile

I will try to see what you did beyond the original so i can understand why I was getting the 500 error.

again, ty very much for the hard work.
View user's profile Send private message
gator81
Worker
Worker


Joined: Jun 09, 2007
Posts: 108

PostPosted: Tue Jan 13, 2009 8:21 pm Reply with quote Back to top

This is working great, and if you dont mind, i would like to ask another question......Smile

could this be used in more then just a module and or block?

Now I am not wanting to push my luck Smile but if I dont ask then I dont know. But could the quotes be added to like a content post? or placed in the header or like the bar you see at the header, like where you have "home,downloads,forums".

This is not a have to thing, but a question to see if it could be done without alot of problems.

thanks for the input
View user's profile Send private message
jakec
Site Admin


Joined: Feb 06, 2006
Posts: 3038
Location: United Kingdom

PostPosted: Wed Jan 14, 2009 1:35 am Reply with quote Back to top

I've just changed the SQL queries to suit the new layer, so these should not have been causing an error 500.

There is no reason why these couldn't be added to the header, but it would require a hack of the theme.
View user's profile Send private message
gator81
Worker
Worker


Joined: Jun 09, 2007
Posts: 108

PostPosted: Wed Jan 14, 2009 2:10 am Reply with quote Back to top

jakec, you have been a great help, and If i am being to much of a pest please let me know...What you have done has helped me a lot already. Since you have the whole program, you should either add your name to the copyrite or with your skill you could probally improve on it and release one on your own Smile

My other question about putting the quote other places on the site, would I need to basically use all the code that would be in the block-Quotes.php file? and try to get it to load in the certian areas?

I am a trial and error person, so I ask alot of questions, I just try to be carefull not to abuse the help that I am getting.
View user's profile Send private message
jakec
Site Admin


Joined: Feb 06, 2006
Posts: 3038
Location: United Kingdom

PostPosted: Wed Jan 14, 2009 7:46 am Reply with quote Back to top

I'll need to have a look at the code tonight, but be under no illusion than I am an expert, I am very much a trial and error person like you. Wink

I am not too bothered about the copyright, the changes I made were minor and the module could probably do with a security check by one of the experts here. I am not saying that there is a problem, but I am not the person to say either way.
View user's profile Send private message
gator81
Worker
Worker


Joined: Jun 09, 2007
Posts: 108

PostPosted: Wed Jan 14, 2009 2:09 pm Reply with quote Back to top

I thank you for being humble, to me your trial and error are on such a higher level then myself. I would be happy just to have your level of skill, I would be someone then Smile
Again, ty for your help and time you are putting into this.
View user's profile Send private message
jakec
Site Admin


Joined: Feb 06, 2006
Posts: 3038
Location: United Kingdom

PostPosted: Wed Jan 14, 2009 4:31 pm Reply with quote Back to top

It's definitely possible to add the quotes to your header, but it would require some hacking of the theme you are using. I'm not a theme expert either, but some themes display the latest downloads, or web links in the footer and the principle is the same, just querying a different table in the database.

No problem, for some reason I've always enjoyed helping people. Very Happy
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2456
Location: Pittsburgh, Pennsylvania

PostPosted: Wed Jan 14, 2009 5:01 pm Reply with quote Back to top

This is the code that you need to insert in the given area. Now if you need to add a row or column to a table via html you would need to add that code, but if you are just entering it into an existing cell that this could should be fine. It is possible you could run into a conflict with the variables used in the sql statements, but probably not.

Code:

mt_srand((double)microtime()*1000000);

$quotesql = "SELECT COUNT(qid) FROM ".$prefix."_quotes";
$result = $db->sql_query($quotesql);

if ($result)
{
   list($count) = $db->sql_fetchrow($result);
}
else
{
   $count = 0;
}

if ($count < 1)
{
   $content .= "There aren't enough quotes in the database right now.";
}
else
{
   $index = 1;
   if ($count > 1)
   {
      $index = mt_rand(0, ($count - 1));
   }

   $quotesql = "SELECT quote, author FROM ".$prefix."_quotes ORDER BY qid LIMIT " . sprintf("%d", ($index - 1)) . ", 1";
        $result = $db->sql_query($quotesql);

   if ($result)
   {
      list($quote, $author) = $db->sql_fetchrow($result);
       
      $content .= "<b>" . $quote . "</b>";
      if ($author != "")
      {
         $content .= "<br><br>";
         $content .= "-- " . $author;
      }
   }
   else
   {
      $content .= "A database error has occurred.";
   }
}
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2456
Location: Pittsburgh, Pennsylvania

PostPosted: Wed Jan 14, 2009 5:02 pm Reply with quote Back to top

if you want to make this block xhtml compliant you need to change all the <br> tags to <br /> tags. Not a must, but just an option.
View user's profile Send private message
gator81
Worker
Worker


Joined: Jun 09, 2007
Posts: 108

PostPosted: Thu Jan 15, 2009 1:17 am Reply with quote Back to top

as time permits i will see what iit will do thanks
View user's profile Send private message
jakec
Site Admin


Joined: Feb 06, 2006
Posts: 3038
Location: United Kingdom

PostPosted: Thu Jan 15, 2009 1:23 am Reply with quote Back to top

Good point Palbin, I should of checked for compliancy when I changed the DB layer. Doh
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum