I was developing a site which used the 'seemingly now disappeared' method for calling the widgit via theme_vote_up_down($nid, 'node') where the NID and 'type' could be put straight into the function - this was the method for displaying the widgit and voting.
In Beta4 this seems to have disappeared, and been replaced by a more complex set of sub-functions.
What would be the best way to implement the functionality of this depreciated function?
Using node.tpl.php is inpractical - I'm calling NIDs straight from the database, the overhead of a custom .tpl.php file would be atrocious.
Comments
Comment #1
zhte commentedSorry, title should be: theme_vote_up_down_widget($nid, 'node')
The code for this function was:
Comment #2
mrwendell commentedThey are now using preprocess variables in combination with theme files, instead of the venerable themable function.
Look in vote_up_down.module for the following functions
You can overwrite/add variables by copying the function to your template.php file of your theme and renaming to
THEMENAME_preprocess_vote_up_down_widget
THEMENAME_preprocess_vote_up_down_widget_alt
THEMENAME_preprocess_vote_up_down_points
where THEMENAME is a place holder for your theme's name, or you could try 'phptemplate' which should also work, though I haven't tried. This can be a quick way to do things like overwrite labels (e.g. points -> diggs ) without having to overwriting the widget layout.
To do the latter, the theme files can be found in
/sites/all/modules/vote_up_down/themes
You can copy the appropriate theme file to your theme directory and modify how the widget HTML is formed.
I found this out using the devel.module (http://drupal.org/project/devel) and enabling the drupal themer info. This will give you a run down of all files and functions used to create a specific component on your site.
Happy Voting!