Res facta quae tamen fingi potuit (
pauamma) wrote in
dw_dev_training2011-11-21 05:27 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[site community profile]](https://www.dreamwidth.org/img/comm_staff.png)
Entry tags:
Question thread #3
It's time for another question thread!
The rules:
- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer.
The rules:
- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer.
no subject
As far as I can tell, with the table, what it changes is that if $moodtheme_extra is false, then all the example "mood theme" images/descriptions (which are contained in <td> elements) are in ONE row. If $moodtheme_extra is true, then after every 2nd image it inserts a new <tr>. But not knowing what the heck mood_theme_extra_content is, I don't know why it's doing that or whether I should also do that. I wasn't sure also if maybe this is related to the width of the table, b/c I just told my CSS positioning to size the width of that element automatically, but ...if mood_theme_extra_content is related to mood themes that are extra super wide or something, maybe that is why it happened? (I'm positioning those elements with float:left so I could just add in a clear:left probably to the same effect.) (eta: or set a maximum width to the containing element to eliminate the need for this workaround?)
Anyway, confusion. I figure also for testing purposes it's important to know what that hook means so I can test the two different cases. On that end, also, I guess I have another question. How do I make a user account in my dreamhack a "paid account" so I can test paid features? Maybe there is an obvious answer to this somewhere but I couldn't find it on the wiki.
no subject
meanwhile, without looking into it too closely, i'm going to guess that mood_theme_extra_content is almost certainly some ljcom hook (the non-free lj code), and therefore we don't have it -- most (though not all) of the hooks defined in the code are. To look for where in the code it's referenced, you'd do:
rgrep -i mood_theme_extra_content $LJHOME/cvs/dw-free/* | more
rgrep -i mood_theme_extra_content $LJHOME/cvs/dw-nonfree/* | more
Since neither returns any results except the bit in the widget, it's pretty certain that it was a ljcom-specific hook (and now i'm curious; i looked it up (don't worry, you aren't supposed to know where to find it, I just happened to) and it looks like it has to do with sponsored mood themes, which we don't have. (There are a lot of hooks scattered around the code that LJ used to pull in ljcom-specific things like that -- some of them we've repurposed for other dw-nonfree things that are useful, some of them we just ignore.) So you can safely ignore it.
no subject
rgrep -i mood_theme_extra_content * > whatevertempfilename
while in the parent directory of my dreamhack, and those were the only places where it showed up.
What categorizes "ljcom" things? Are they all related to sponsored things, or are they code bits that are not open source or something? I wasn't really positive why the Mercurial repositories have both the "dw-free" and "dw-nonfree" branches (but the live directory doesn't?).
Since DW has no sponsored mood themes, in working on editing that module to use CSS positioning should I also edit it to not take that hook+corresponding variables into account? Rather than having lines of code that serve no purpose / do nothing? Or comment them out or something?
Also there were some hooks I was unfamiliar with also when I was poking at S2PropGroup.pm (which I've taken a break from to work on others instead). I don't remember them off the top of my head, but, it looks like that thing you linked to might be a good place to look up some of them. If there are some that don't appear to be registered anywhere in the DW build that I have, but I find them on that site, is it usually the case that they are ljcom things that are not in use? Should I double check any time I find one like that before assuming that it doesn't serve a purpose?
P.S. Thanks, it was causing me immense aggravation not being able to find that thing anywhere, ha.
no subject
In general, if you see a hook being called in the code but you can't find any place where the hook is actually defined, it's almost certainly a ljcom hook. You can check for it in the ljcom code, but you can't copy or use that code.
(ljcom is the LJ equivalent of dw-nonfree: it is source-available (for comparison) but not Open Source and other sites can't use it. livejournal is the LJ equivalent of dw-free, which is freely usable anywhere. When we forked from LJ, we were only legally permitted to use things in the livejournal repository, not livejournal + ljcom the way livejournal.com uses, which is one reason why there are features on livejournal.com that we don't have.)
In this case, yeah, I'd just go ahead and remove that hook call in the mood theme widget if you're working there, since there's no reason to have it other than for something we don't use. If someone needs a hook there again in the future, they can make a new one.
no subject
I am curious: why is some of the DW code open source but the stuff in dw-nonfree isn't?
no subject
no subject
no subject