?

Log in

No account? Create an account

Previous Entry | Next Entry

How to add "reputation" under userpics?

  • Oct. 24th, 2007 at 1:04 PM
So I chat a lot on vBulletin type of forums, and what i really like there is "reputation" which users can give to each other. At the bottom one can see how this reputation accumulates, and can also determine who is "popular".

I don't want to make this "reputation" available for all users in my community to give. But as a moderator, I wish I could give "points" to the users, which would accumulate and display somehow under their userpic.

My community is a paid account. I don't know much about programming, I do know HTML though, but I don't believe HTML would be able to do it. I would need "S2" or "java" or "php"... anybody? Help? PLEASE?

I have "Expressive Seasonal": buonappetito

Comments

av8rmike
Oct. 25th, 2007 05:56 pm (UTC)
OK, this is going to look really complicated, but it's not. ;) Replace the previous code I gave you with this one.
Basically, the users and their corresponding group is stored in the $users_groups{} associative array. The user name goes in the first column, the group to which they belong goes in the second (The => "points to" the user's group). In the array $new_usericons{}, put the group name first, then the URL to the icon you want to use for that group. I've done "maintainers" as an example. You can add as many groups as you want to each array; however, a user can't be in more than one group at once. Similarly, you can't have more than one icon per group.
function Page::print_custom_head() {
  # User name first, then the corresponding group name
  var string{} users_groups = { "duseg" => "maintainers",
                                "elladkin" => "maintainers",
                                "lentyajka_01" => "maintainers",
                                "user1" => "group1",
                                "user2" => "group1",
                                "user3" => "group2",
                                "user4" => "group2" };

  # The ljuser icon for each group
  var string{} new_usericons = { "maintainers" => "http://img522.imageshack.us/img522/73/buonappetitoberrytx2.gif",
                                 "group1" => "URL to icon for this group",
                                 "group2" => "URL to icon for this group" };
  var string old_usericon = "http://stat.livejournal.com/img/userinfo.gif";
  """<style type="text/css">""";

  foreach var string user ($users_groups) {
    var string user_url = "http://${user}.livejournal.com/profile";
    var string new_usericon = $new_usericons{$users_groups{$user}} != "" ? $new_usericons{$users_groups{$user}} : $old_usericon;
    """
.ljuser a[href="$user_url"] img[src="$old_usericon"] {
    width: 0;
    height: 0;
    background-repeat: no-repeat;
    background-image: url($new_usericon);
    padding: 16px 0 0 17px !important;
}
""";
  }
"""</style>""";
}
The code compiled OK for me, but I couldn't test the results because I'm limited to IE 6 at the moment. Let me know if you have other questions.
duseg
Oct. 25th, 2007 06:24 pm (UTC)
wow. i love ya :)
thank you!

/you are going to laugh at me now, but asking this made me actually go into tutorial and learn more about s2, and the layers. as i tried adding your code into a new layer, and it didn't work. i will get it soon, and will let you know how it worked, with the screenshot/
duseg
Oct. 26th, 2007 02:46 am (UTC)
i don't know what i am doing wrong. maybe i didn't comprehand the basics. if i have a "custom css", none of my changes in the layers are visible.

if i delete custom user layer, and work in customizing a theme layer, still nothing is visible and... what am i doing wrong? not only this code doesn't work, none of my other changes show up

i have read this and this...

and now something crazy happened to the customization area and i can't return what i had before. what the heck happened????? they totally changed it, and i am ready to scream

somebody shoot me please!

av8rmike
Oct. 26th, 2007 01:22 pm (UTC)
Yes, LiveJournal just yesterday ended the beta test phase of the new customization section and made it active for everyone. And there was much grumbling (not just you, lots of people). =(

There's a tutorial here about making a theme layer for Expressive. The only thing that's different now is how you access the Advanced area:
  1. Go to customize page, then click on "Developer Area" on the left. This section's design hasn't changed at all.
  2. Click "Your Layers"
  3. Select the community in the "Work as user:" pull-down box and hit Switch.
  4. You can either create a new theme layer or use an existing one, if you still have one. Add in the code I gave you to the theme layer and compile. Just make sure you include these lines at the top of the layer along with the layerinfo lines:
    set base_theme = "holiday-stripes-green";
    set theme_designer = "Lilia Ahner";
    set theme_designer_type = "outside";
  5. I haven't found if there's an easy way to apply a custom theme in the new system. So, we do this the old way. Back to the "Advanced" section and click "Your Styles"
  6. Select the community in the "Work as user:" pull-down box and hit Switch.
  7. There should be any of several styles, with one of them in bold. This is the "active" style, and will probably have "wizard-voxhtml" in it. Click Edit next to it.
  8. There should be a box that says "Expressive" next to Layout and a box under that that says Theme. In Theme, scroll down to the bottom and select the theme layer you just edited/created, then "Save Changes". This attaches your custom theme layer to the layout instead of one of the default themes.
At this point, the code should be active, but your customzied CSS won't be. You can add that back in at this page in the customization section, just click Custom CSS on the left sidebar. Got all that? ;)
duseg
Oct. 26th, 2007 05:04 pm (UTC)
thank you mike. i will try tonight again.
av8rmike
Oct. 26th, 2007 03:44 pm (UTC)
You could also apply the custom theme layer the easy way: Instead of step 5 and on above, go to the main customization page and click "My Custom Layers" in the left sidebar, then choose the layer you created in the first steps.

Latest Month

March 2016
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  

S2 Help Communities

Tags

Powered by LiveJournal.com
Designed by chasethestars