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.
|
|
|
|
|
![]() |
||
[SOLVED] Page count?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
[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)
|
|
|
|
|||
|
Re: Page count?
What exactly do you want to auto update?
Last Blog Entry: My blog? (Oct 18th, 2007)
|
|
||||
|
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)
|
|
||||
|
Re: Page count?
You could do this with PHP. Not javascript.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
||||
|
Re: Page count?
and you probably won't be able to do any PHP with a tripod account.
|
|
|||
|
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:
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)
|
|
||||
|
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)
|
|
|||
|
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)
|
|
|||
|
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)
|
|
||||
|
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)
|
|
|||
|
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)
|
|
||||
|
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 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)
|
![]() |
| Thread Tools | |
|
|
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 |