Help for adding content on website.

  • doooh
  • Novice
  • Novice
  • doooh
  • Posts: 32
  • Loc: Italy (Banana Republic)

Post 3+ Months Ago

Hi, I am developing my website and I have a section of proverbs, with 6 proverbs each page and then you have to go to the next page. When I add new ones I want them to be in the fist page, is there a way to automate the process of putting the ones on page one to page two, from page two to page three and so on to leave space on page one for the new ones without doing it manually?
Ps, I use Dreamweaver CS4 as my web editor.
Thanks in advance, :D :D
Marwan
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

You could do that in PHP... I'm just having a hard time trying to imagine what you are describing.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

Bogey - think CMS that sorts articles in newest-to-oldest order. When you make a new post, it takes the first position and each article is bumped down a spot (including over the pagination).
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

Oh I get it now... just that the improper grammar threw me off a little bit... English is not my native tongue.
  • doooh
  • Novice
  • Novice
  • doooh
  • Posts: 32
  • Loc: Italy (Banana Republic)

Post 3+ Months Ago

So, PHP huh? how do you do that? I mean, I know I should learn php ok, but can you indicate this specific posting thing so that I can start with that?
Thanks
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

I've started developing my own systems like this in lieu of using CMSs. In fact, I've developed a system just for Bible verses.

The first thing to do is develop a PHP/MySQL (server-side scripting/database) system of entering and storing your articles, or Proverbs in this case. You'll need a hosting account with PHP and a MySQL database. You could also use a flat-file like XML.

To do this, you'd setup a table in your database(or setup your XML). Mine looks like this...
Attachments:
phpbible0.gif


This stores the info. Now you'll need to access and manipulate the data in real time. That's where PHP comes in.

I developed a management console that looks like this...
Attachments:
phpbible1.gif

Manage


From this management console I can access the other functions Add, Edit and Delete.
Attachments:
phpbible2.gif

Add


Attachments:
phpbible3.gif

Edit


Attachments:
phpbible4.gif

Delete



Lastly, I built the random display pog. The output appears like so...
Attachments:
phpbible5.gif

Output



The PHP for the output pog can be inserted anywhere on the site and looks like this...
PHP Code: [ Select ]
<?
include_once 'connect_db.php';
$findrow = mysql_query("SELECT id FROM verses");
$numRows = mysql_num_rows($findrow);
$randNum = rand(1,$numRows);
$result = mysql_query("SELECT citation, body FROM verses WHERE id=".$randNum);
$row = mysql_fetch_array($result);
echo "<p><strong>".stripslashes($row['citation'])."</strong><br />".stripslashes($row['body'])."</p>";
?>
  1. <?
  2. include_once 'connect_db.php';
  3. $findrow = mysql_query("SELECT id FROM verses");
  4. $numRows = mysql_num_rows($findrow);
  5. $randNum = rand(1,$numRows);
  6. $result = mysql_query("SELECT citation, body FROM verses WHERE id=".$randNum);
  7. $row = mysql_fetch_array($result);
  8. echo "<p><strong>".stripslashes($row['citation'])."</strong><br />".stripslashes($row['body'])."</p>";
  9. ?>


Now, instead of randomly displaying one entry, you would use the SQL Query in your PHP to sort the entries in a particular manner, then grab 1 batch at a time. To paginate, you would simply move the next batch, incrementally. You could add a date column for this, use the id column, sort them alphbetically, by verse number, etc.

It sounds like a great project to learn PHP/MySQL if you don't know any! :)

HTH.
  • doooh
  • Novice
  • Novice
  • doooh
  • Posts: 32
  • Loc: Italy (Banana Republic)

Post 3+ Months Ago

ok, I found cmsmadesimple, it was one of the first on google and seems pretty good. my hosting is with an italian company "Aruba", which is the market leader here. It supports php and I have unlimited webspace, but mysql databases are optional and you have to pay for them.. Do I have to buy it or is there a way to put it on my website without buying?

It costs 7 euro (roughly 11 dollars) so it's not a big deal, but I'm too stressed for the boureocracy to buy it, so if it's possible without buying it would be better.

By the way, there are two options, MySql (100 mb) and MySQL server (100 mb). what's the difference?
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

I would recommend that you pay the host company for the database usability. It's easier to let them deal with maintaining everything altogether and keeps your site and databases on the same server. That being said, don't buy too much. For something as simple as this, I would recommend you buy one (or the smallest amount) database and prepend your tables. One database is enough to drive several projects. What I mean by that is this:

Buy one database (when you name it, keep it general)
Set up tables with, say, 'siteName_' on the front
When your next project comes along, you swap the prefix
One database, multiple projects. TADA! :)

So that would mean you could have something like:

database: JohnDoeDevelopment
table: churchSite_table1
table: churchSite_table2
table: familyAlbum_table1
table: familyAlbum_table2
table: fundRaiserSite_table1
table: fundRaiserSite_table2

As for the options, it's hard to tell without looking at what they say about them, but it sounds like dedicated MySQL server vs. keeping MySQL on your current server. Go with the cheaper.

I'd also recommend you shop around for CMS solutions rather than grabbing the first you see. There are a ton of variations in usability, setup, support, etc. I'd also venture here to say that if proverbs are the only thing that are going to change on the site much, something like what digitalMedia has shown as an example would fit your needs better (grab a random proverb from the database and slap in it an existing page). If you plan to show articles, sermons, etc. with frequent lifecycle (new post every week, for example), THEN a CMS would fit your needs (you typically build your whole site/style around these).
  • doooh
  • Novice
  • Novice
  • doooh
  • Posts: 32
  • Loc: Italy (Banana Republic)

Post 3+ Months Ago

ok thanks,
by the way it's a humor site, I am posting images, videos, flash animations and games and funny proverbs.
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

doooh wrote:
ok thanks,
by the way it's a humor site, I am posting images, videos, flash animations and games and funny proverbs.


:lol:

Sorry, my bad assumption.
  • doooh
  • Novice
  • Novice
  • doooh
  • Posts: 32
  • Loc: Italy (Banana Republic)

Post 3+ Months Ago

ok, to make the database what program do I need? I'm a complete noob, I just did a little bit of ms access and vba last year at school. But, I can learn...
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

doooh wrote:
ok, to make the database what program do I need? I'm a complete noob, I just did a little bit of ms access and vba last year at school. But, I can learn...


If you have a database with your hosting account, they will provide an management interface. The one I posted above is phpMyAdmin and can be accessed through my hosting account's control panel.

In the control panel you can create databases and assign users/permissions. From there you should be able to access a management console where you can directly work on the database and its data.

Post Information

  • Total Posts in this topic: 12 posts
  • Users browsing this forum: No registered users and 77 guests
  • 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 post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.