PDA

View Full Version : js for multiple user blog


Malva
12-29-2002, 02:04 PM
hi everyone!

I have a team-blog at blogger.com, and I would like every user to have his own font color, but I can't tell the to do it manually because they don't know a anything about html.

Is there anyway to do this in javascript?

I could really use some help.

Thanks a lot!

chrismiceli
12-29-2002, 06:07 PM
you could do like this w/ style
<script>
bob = "font:whatever;size:whatever
joe = "//etc
//then split it like this
bob = bob.split(";");
bob-font = bob[0].split(":");
bob-font-size = bob[1].split(":");
document.body.style.font = bob-font[1];
document.body.style.font-size = bob-font-size[1];
</script>

piz
12-29-2002, 06:10 PM
you should do this in PHP.

Of course its possible in JavaScript, but its a "bit" complicated and much work i think - depends on the site.

ah no, but you can do itt like this:

how many user u have?

you can make styles for each user. but then every user need its own html-dokument if you want to do it with javascript.

you assign classes to the elements you want to change their font.

for example:
<font class="user1">

and then in the stylesheet:

.user1 {
font-family: Tahoma;
}

to make logins with js is difficult - and not secure.

don't know if i understood you right. post another time if not.

saludo
piz

Malva
12-29-2002, 08:03 PM
hi piz

there are 7 users in my blog.

I tried to do something similiar -- using stylesheets -- but it didn't work, because i am the only one who knows html.

I was wondering: in the template, you write something like <$BlogItemAuthor$>, and Blogger converts it to your name. But how does it work? What's the file that contains this information? If I could edit this file, and upload it to my own host, maybe I could add my own tags.

Not sure if it makes sense, but I have no idea where to begin with.

piz
12-29-2002, 08:27 PM
you have 7 users.
and you want to have 7 different designs with the same template.

you can do something like chrismiceli said.

http://yoursite.tld?user=username

then you can filter the username with javascript and write in the head this:
(if username is the variable which contains the username)

<script>
document.writeln('<link href="' + username + '.css" rel="stylesheet" type="text/css">');
</script>

so you have to make a stylesheet for each user.

why don't you do it with php?