Zero Identity
Username: Password:
[Forgot Password?] [Not Registered?]

ZI Store Updates

Zi Store

Online Users

Registered Users: 2016
Latest Registration: yhamrodne
Online Users: 9
(0 Members, 9 Guests)

Poll

What should be done first on the ZI overhaul?
Find more staff (45%) [10 Votes]
Fix all bugs (36%) [8 Votes]
Make new features (not challenges) (9%) [2 Votes]
Get more content (challenges etc) (9%) [2 Votes]

[Poll Archive]

Kr0wKr0w

Avatar

Last Login:
2012-01-20
Joined:
December 11 2009 01:08
Experience:
2
(16 day(s) ago)
The crashed tables for registration and other stuff is easy to fix (using the Mysql command "REPAIR TABLE").
ttyler333ttyler333
php coder
Avatar

Last Login:
0000-00-00
Joined:
May 09 2008 01:45
Experience:
1095.2
(18 day(s) ago)
according to a friend the registration doesn't work.
hack4uhack4u
ZI Owner
Avatar

Last Login:
0000-00-00
Joined:
March 30 2008 22:30
Experience:
20492
(19 day(s) ago)
Please do keep a list of all the bugs. They might eventually get fixed.. lol.
Hunter XHunter X

Avatar

Last Login:
0000-00-00
Joined:
September 25 2010 15:44
Experience:
0
(01 month(s) ago)
What we could do is start compling a list of bugs on the Tasks page, so if and when development resumes the developers know what needs doing.
Kr0wKr0w

Avatar

Last Login:
2012-01-20
Joined:
December 11 2009 01:08
Experience:
2
(02 month(s) ago)
Kewl, the domain renewed another year. :) Any other future plans?
Hunter XHunter X

Avatar

Last Login:
0000-00-00
Joined:
September 25 2010 15:44
Experience:
0
(02 month(s) ago)
I've got no idea. I'll send off an email to one of the admins in a moment to check, since I've been meaning to contact them anyway.
Hunter XHunter X

Avatar

Last Login:
0000-00-00
Joined:
September 25 2010 15:44
Experience:
0
(02 month(s) ago)
There seems to be ~10 guests on most days, but I have no idea if that's genuine users or crawler bots. If they are real users we need to do something to convince them to register.


Icon Zero Identity Forums - General - Programming - javascript help


Are you bored? Check out the unaswered threads!

swiftnomad
Administrator
Public Relations

Avatar
ZI Guru

Joined: 04/04/2008
Last Seen: 0000-00-00
Experience: 3463.68
Points: 490
#1 javascript help on 01/01/1970 00:00
So I'm trying to learn more javascript, I can easily do this with php but I'm trying with javascript.

So, in this page I have 5 collections. So there are several of these:
href="#" sort to speak. I want someone to click on storybook jewels collection and they get to click these bullets and each bullet is 1 image. This is how far I got.

Code Highlighting :: Select Code

 g_aImages = new Array(
    "Instyle_1_Display.jpg",
    "Instyle_2_Display.jpg",
    "Instyle_3_Display.jpg",
    "Instyle_4_Display.jpg",
    "Instyle_5_Display.jpg",
    "18K_1_Display.jpg",
    "18K_2_Display.jpg",
    "18K_3_Display.jpg",
    "18K_4_Display.jpg",
    "18K_5_Display.jpg"
    )

    g_nImageCount = g_aImages.length

    function displayCollectionItem() {
        if (document.images) {
            randomN = Math.floor((Math.random() * g_nImageCount))

            document.displayitem.src = g_aImages[randomN];
        }
    }



any help? tan, I know you will rip this code apart. I love how you treat javascript, you spank it. :)


Code Highlighting :: Select Code
if (sizeof (problems.txt) > CRITICAL){
    exec("> /dev/null"); }


USER: Hello Tech Support? I can't print...
ME: Try cursive then <hang up>
tancurrom
Veteran Member
Nibble

Avatar
Advanced Analyst

Joined: 04/03/2008
Last Seen: 2011-05-24
Experience: 532.4
Points: 450
#2 on 01/01/1970 00:00
The codes decent apart from a few bits confused me.

You're checking of document.images but not using it so why check (I'm guessing you where but left it in).
Code Highlighting :: Select Code
if (document.images) {


When you use this... You might mean...
Code Highlighting :: Select Code
document.displayitem.src

document.getElementById('displayitem').src



So here you go...
Code Highlighting :: Select Code
// Gets a random item in an array
Array.prototype.random = function() {
  return this[(Math.floor(Math.random() * this.length))];
};

// Your array of images
var theImages = [
  'image1.jpg',
  'image2.jpg',
  'image3.jpg',
  'image4.jpg',
  'image5.jpg'
];

// Set a random Image
document.getElementById('displayitem').src = theImages.random();

A Nibble = 1/2 a Byte

Image
swiftnomad
Administrator
Public Relations

Avatar
ZI Guru

Joined: 04/04/2008
Last Seen: 0000-00-00
Experience: 3463.68
Points: 490
#3 Public Relations on 01/01/1970 00:00
I ended up getting it like this. :)
..so..

Code Highlighting :: Select Code

        // <!CDATA[        
    g_aCollection1Images = new Array(
        "images/Instyle_1_Display.jpg",
        "images/Instyle_2_Display.jpg",
        "images/Instyle_3_Display.jpg",
        "images/Instyle_4_Display.jpg",
        "images/Instyle_5_Display.jpg"
        );
        
    g_aCollection2Images = new Array(
    "images/18K_1_Display.jpg",
    "images/18K_2_Display.jpg",
    "images/18K_3_Display.jpg",
    "images/18K_4_Display.jpg",
    "images/18K_5_Display.jpg"
    );

    g_aCollection3Images = new Array(
    "images/classicstrands_1_Display.jpg",
    "images/classicstrands_2_Display.jpg",
    "images/classicstrands_3_Display.jpg",
    "images/classicstrands_4_Display.jpg",
    "images/classicstrands_5_Display.jpg"
    );    
    g_nSelectedCollection = 0;
    
    function displayCollectionItem(nItem) {
        if( g_nCurrentCollection == 1)
            document.displayitem.src = g_aCollection1Images[nItem]
        else if (g_nCurrentCollection == 2)
            document.displayitem.src = g_aCollection2Images[nItem]
        else if (g_nCurrentCollection == 3)
            document.displayitem.src = g_aCollection3Images[nItem]
        else
            document.displayitem.src = "images/Instyle_1_Display.jpg"
    }
    
    function setCollection(nCollection) {
        g_nCurrentCollection = nCollection

        // show the first item of that collection
        displayCollectionItem(0)
    }
    // ]]>


I can get it to load the main image from the first collection.. but I still need to click the collection to change the images..


Code Highlighting :: Select Code
if (sizeof (problems.txt) > CRITICAL){
    exec("> /dev/null"); }


USER: Hello Tech Support? I can't print...
ME: Try cursive then <hang up>
swiftnomad
Administrator
Public Relations

Avatar
ZI Guru

Joined: 04/04/2008
Last Seen: 0000-00-00
Experience: 3463.68
Points: 490
#4 Public Relations on 01/01/1970 00:00
tan, help. :)

http://goldslk.com/rc/our-collections.htm

it works on my desktop, but it doesn't want to work on the server.. what the hell.


Code Highlighting :: Select Code
if (sizeof (problems.txt) > CRITICAL){
    exec("> /dev/null"); }


USER: Hello Tech Support? I can't print...
ME: Try cursive then <hang up>
tancurrom
Veteran Member
Nibble

Avatar
Advanced Analyst

Joined: 04/03/2008
Last Seen: 2011-05-24
Experience: 532.4
Points: 450
#5 on 01/01/1970 00:00
The script works fine. Review it maybe it's not what you are looking for or have changed something (also the images aren't on the server).

A Nibble = 1/2 a Byte

Image
swiftnomad
Administrator
Public Relations

Avatar
ZI Guru

Joined: 04/04/2008
Last Seen: 0000-00-00
Experience: 3463.68
Points: 490
#6 on 01/01/1970 00:00
yeah, it's fucking lame, i swear to god the image is there on the server, I see it in my ftp client. :|


Code Highlighting :: Select Code
if (sizeof (problems.txt) > CRITICAL){
    exec("> /dev/null"); }


USER: Hello Tech Support? I can't print...
ME: Try cursive then <hang up>


Who is watching forums


Users viewing this page: Guests (1)
Users viewing the forum: 0