[SOLVED] Page count?

This is a discussion on "[SOLVED] Page count?" within the JavaScript Forum section. This forum, and the thread "[SOLVED] Page count? are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Nov 6th, 2007, 14:23
unitedcraig's Avatar
SuperMember

SuperMember
Join Date: Oct 2007
Location: Stockport
Age: 17
Posts: 844
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
[SOLVED] Page count?

i have in the process of developing a website http://freestuffsyt.tripod.com and i will eventually be adding a lot more articles. as you will see if you visit the site i have a count of how many pieces of software i have added.

is there a way that i can get this to automatically update as more pages are added,

i am not sure if this will be achived using javescript but i am not sure how (if how) i can achieve.

please comment or send me to the right section of the forum

thanks

craig
__________________
Last Blog Entry: A Royal Mistake (Feb 20th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Nov 6th, 2007, 15:16
mcdanielnc89's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Missouri
Age: 19
Posts: 232
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Page count?

What exactly do you want to auto update?
Last Blog Entry: My blog? (Oct 18th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Nov 6th, 2007, 15:29
unitedcraig's Avatar
SuperMember

SuperMember
Join Date: Oct 2007
Location: Stockport
Age: 17
Posts: 844
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
Re: Page count?

if you go on my site, on top of the right hand collum there is a heading saying items added - 2.

currently i am manually changing the number of items because there obviously isnt a great deal of itms added.

what i am looking for is a way to have this linked to the number of items added, perhaps to the number of files on the software folder?

is this possible or am i being a bit hopeful lol?

cheers
__________________
Last Blog Entry: A Royal Mistake (Feb 20th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Nov 6th, 2007, 15:36
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Page count?

You could do this with PHP. Not javascript.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old Nov 6th, 2007, 17:02
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Page count?

and you probably won't be able to do any PHP with a tripod account.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old Nov 6th, 2007, 17:40
Reputable Member
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Page count?

Craig, this is how I understand your problem:
You will be adding new pages to your website. You need to show on every page how many items are added on your site. At the moment, you edit the HTML of every page individually to update the number. But you want that update to happen automatically every time you add a new page to the site. If I have got it correct, then plz read my solution.

I could not think of how to automante the entire process. If you follow my solution, each time you add a new page, you will have to update only 1 character in a file.

Here is the solution:
1. Open your template file and go to H4 tag( Item added) as show below:


2. Replace the text in H4 tag with <script src="items_added.js"></script> (See below image)


3. Create a file by the name items_added.js in home directory
4. In that new file(items_added.js), copy-paste the below code:
Code: Select all
document.write("Items added - #")
# in above code is the no. of items added to the site. So every time you added a new item yo your site, you will have to change this number.(This is the only number you have change,about which I said earlier)
You can format the elements according to your needs.

5. Now upload the .js file and also make changes to the pages you have already uploaded.

You are done with it!

I use something similar on my site www.BiologyForMhtcet.com. Did you notice the random quotes(in black color font) just below the header on every page ? They are produced using similar technique, except that functions are a step ahead.
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #7  
Old Nov 6th, 2007, 20:39
unitedcraig's Avatar
SuperMember

SuperMember
Join Date: Oct 2007
Location: Stockport
Age: 17
Posts: 844
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
Re: Page count?

firstly, thanks a lot for your time, you hav answered another question i was going to ask about updating the whole of the site

and what i really wanted to find out on this post was slightly different. the items added is just displayed on the home page, and i would like to know if this can be changed automatically as more items are added. i do it jsut by altering the html now because as you can see there are only 2/3 items added, but eventually i hope to have a lot more items.

is there a way that you know off to get the value to change everytime i uploaded a file to the software folder for example?

if not dont worry, thanks a lot for your time for my second question

craig
__________________
Last Blog Entry: A Royal Mistake (Feb 20th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #8  
Old Nov 7th, 2007, 02:24
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Page count?

How do you upload your file to your software folder? Manually upload them (from the website file manager) of through your page (like uploading picture and stuff..)??
Do you have a database?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #9  
Old Nov 7th, 2007, 03:30
Reputable Member
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Page count?

@ Craig (post#7)
I am happy I could answer atleast 1 of your question.

Anywayz, I am thinking about this one!
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #10  
Old Nov 7th, 2007, 05:49
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Page count?

Craig, if you used PHP then you would be able to count how many files were in a directory and display that.
You are using crappy tripod account so there's no chance of that!

Is changing one file that difficult? It's not as if you are going to be uploading 100s of articles a day, unless you're stealing other people's articles!

Either, get a better host without ads and supports php (Simon's currently offering hosting for $2!), or you can manually edit one file.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #11  
Old Nov 7th, 2007, 06:28
Reputable Member
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Page count?

@ Craig, this is not what you asked for but I swill still suggest.
Try www.x10hosting.com if you want free hosting.
You will have an ad-free site with cPanel control panel and many more things.
I have personally used them and would recommmend them to anybody looking for free hosting.
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #12  
Old Nov 7th, 2007, 07:07
unitedcraig's Avatar
SuperMember

SuperMember
Join Date: Oct 2007
Location: Stockport
Age: 17
Posts: 844
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
Smile Re: Page count?

thanks for all your responses, i didnt think that such a ramdom question would get this much attention

alexgeek, unfortunetly yes i am using a crappy tripod account, i will get round to changing that soonish, and yeh changing 1 file doesnt really give me that much more work does it i realise you didnt mean this in an offensive way but i can assure you that i am not stealing other people articles, 1. i am not like that, i respect other people's hard work, and 2. if i were doing that, wouldnt i have more than 3 acticles

monie, using ftp from dreamweaver atm, but going to change hosting account to support php

ronhan shenoy, thanks a lot for your help on this, and i think i wil switch to that hosting plan you reccomended

thanks you all for your help, thread closed
__________________
Last Blog Entry: A Royal Mistake (Feb 20th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Post Count Not Going Up... TheLion Webforumz Cafe 1 Jan 16th, 2008 09:57
[SOLVED] Count something in MySQL Table? Jack Franklin PHP Forum 5 Jan 11th, 2008 17:46
[SOLVED] new page, with page numbers saltedm8 PHP Forum 9 Oct 5th, 2007 14:45


All times are GMT. The time now is 18:08.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42