Hopalong Knut-update and made artist-widget-order random

This commit is contained in:
Sjur Hernes committed 2011-07-03 20:41:38 +02:00
1 parent c11bef9a16
commit 5c9d716f31
5 files changed
+21 -17

No files matched your search

+4 -1
View File
@@ -1,3 +1,6 @@
[submodule "wp-content/plugins/neuf-events"]
path = wp-content/plugins/neuf-events
url = git@github.com:neuf/neuf-events.git
url = git@github.com:neuf/neuf-events.git
[submodule "wp-content/plugins/neuf-venues"]
path = wp-content/plugins/neuf-venues
url = git@github.com:neuf/Neuf-Venues.git
+13 -12
View File
@@ -81,23 +81,24 @@ if (!class_exists("StudioArtist")) {
global $post;
$artist_pop = get_post_meta($post->ID, 'studio_artist_pop' , true);
$artist_font = get_post_meta($post->ID, 'studio_artist_font' , true);
$artist_link = get_post_meta($post->ID, 'studio_artist_link', true);
echo "Størrelse:";
echo '<select name="studio_artist_pop">';
echo $artist_pop;
echo "Fontstørrelse:";
echo '<select name="studio_artist_font">';
echo $artist_font;
$types = array( array('name'=>'Singstar/Guitarhero', 'size' => 12),
array('name'=>'Liten Artist', 'size' => 15),
array('name'=>'Mellomstor Artist', 'size' => 18),
array('name'=>'Stor', 'size' => 21),
array('name'=>'Enorm', 'size' => 24),
$types = array( array('name' => 'Flink i Guitarhero' , 'size' => 12),
array('name' => 'Liten Artist' , 'size' => 15),
array('name' => 'Mellomstor Artist' , 'size' => 18),
array('name' => 'Stor Artist' , 'size' => 21),
array('name' => 'Oh! Dette blir fest!' , 'size' => 24),
array('name' => 'Hopalong Knut!!' , 'size' => 44),
);
foreach($types as $type){
echo '<option value="' . $type['size'] . '"';
if($type['size'] == $artist_pop)
if($type['size'] == $artist_font)
echo ' selected="selected"';
echo '>' . $type['name'] . '</option>';
}
@@ -120,7 +121,7 @@ if (!class_exists("StudioArtist")) {
if ( !current_user_can( 'edit_post', $post_id ) ) return $post_id;
// Get posted data
$studart['studio_artist_pop'] = $_POST['studio_artist_pop' ];
$studart['studio_artist_font'] = $_POST['studio_artist_font' ];
$studart['studio_artist_link'] = $_POST['studio_artist_link'];
foreach($studart as $key=>$value)
@@ -143,7 +144,7 @@ if (!class_exists("StudioArtist")) {
while ( $artister->have_posts() ) {
$artister->the_post();
$size = get_post_meta($post->ID, 'studio_artist_pop', true);
$size = get_post_meta($post->ID, 'studio_artist_font', true);
$html .= ' <li class="title" style="padding-right:10px; font-size:'.$size.'px"><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
}
+2 -3
View File
@@ -48,14 +48,13 @@ class Artist_Widget extends WP_Widget {
function widget($args, $instance) {
global $post, $wp_locale;
$args['title'] = 'Artister';
$studart = new WP_Query( array('post_type' => 'artist', 'posts_per_page' => -1,'meta_key' => 'studio_artist_pop','orderby' => 'meta_value', 'order' => 'ASC'));
$studart = new WP_Query( array('post_type' => 'artist', 'posts_per_page' => -1, 'orderby' => 'rand'));
echo $args['before_widget'] . $args['before_title'] . $args['title'] . $args['after_title'];
if ( $studart->have_posts() ) {
while ( $studart->have_posts() ) {
$studart->the_post();
echo get_post_meta($post->ID, 'studio_artist_pop', true);
$link = get_post_meta($post->ID, 'studio_artist_link', true) ? get_post_meta($post->ID, 'studio_artist_link', true) : get_permalink();
echo '<p style="font-size:'.get_post_meta($post->ID, 'studio_artist_pop', true).'px"><a href="' . $link . '">' . get_the_title() . '</a></p>';
echo '<p style="font-size:'.get_post_meta($post->ID, 'studio_artist_font', true).'px"><a href="' . $link . '">' . get_the_title() . '</a></p>';
}
} echo $args['after_widget'];
}