Hat sich erledigt. Habs hinbekommen. Kann geschlossen werden.
Beiträge von mbbcenter
-
-
Moin,
ich bin dabei ein kleines Plugin zu schreiben. Bei dem Plugin geht es darum, das man für jede Seite drei Bilder wählen kann, die dann auf der jeweiligen auf der rechten Seite angezeigt werden.
Ich hab alles soweit fertig und bin nun bei der Speicherung in der DB. Ich würde gerne die Daten in der wp_option Tabelle speichern und zwar in dem Format wie WP slebst Daten abspeichert, also in der Art:
Codea:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:69:{s:13:"switch_themes"; ...Ich bekomme es aber nicht hin. Ich hab woanders gesehen das jemand es mit
Dies funktioniert aber nicht wie gewünscht. Was ich habe sieht so aus:
PHP
Alles anzeigenforeach($ids as $v) { if($v == $_REQUEST['choosen_page']; { $val['page_'.$v] = array('picname' => $_REQUEST['picname'], 'picuri' => $_REQUEST['picuri']); $val['page_'.$v] = trim($val['page_'.$v], '{}'); } } update_option($option_dbname.'_rightpics', $val);In der DB steht dann:
Meine Frage nun: Wie bekomme ich es in das richtige Format??
Ich habe schon geschaut, aber nichts gefunden. Bin für jede Hilfe oder andere Vorschläge immer Dankbar ;)
-
Vielleicht wäre es auch nicht schlecht zu wissen wie der Codeteil um Zeile 20 in der angegebenen PHP Datei steht.
-
Suppi, das hat geklappt.
Nun hab ich es so:
PHP
Alles anzeigenif(post_password_required()) { echo '<img src="'.ICONS.'comment_pass.png" width="24" height="24" title="'.__('Kommentare Passwort geschützt', $shortname).'" />'; } else { if(comments_open()) { comments_popup_link('0 <img src="'.ICONS.'comment_empty.png" width="24" height="24"" />', '1 <img src="'.ICONS.'comment.png" width="24" height="24" />', '% <img src="'.ICONS.'comment.png" width="24" height="24" />'); } else { echo '<img src="'.ICONS.'comment_closed.png" width="24" height="24" title="'.__('Kommentare geschlossen', $shortname).'" />'; } }Vielen Dank!! :-o:-P
-
Eine comment.php habe ich in meinem Theme ebenfalls, deshalb glaub ich nicht das sie vom DEFAULT nimmt.
Meine comments.php
PHP
Alles anzeigen<!-- ============================================= BEG => comments.php ============================================= --> <?php global $shortname; #__Diese Zeilen nicht löschen!! if(!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die (__('Diese Seite bitte nicht direkt laden. Danke!', $shortname)); if(post_password_required()) { ?> <p class="no_comments"> <?php _e('Dieser Artikel ist Passwort geschützt. ', $shortname)._e('Geben Sie bitte das Passwort ein um die Kommentare sehen zu können.', $shortname); ?> </p> <?php return; } #== END if(post_password_required()) ?> <?php #__Ab hier können Änderungen vorgenommen werden! ?> <div id="comments"> <?php if(have_comments()) : ?> <h3><?php comments_number(__('Keine Kommentare', $shortname), __('1 Kommentar', $shortname), __('% Kommentare', $shortname) );?></h3> <?php __get_xTras('next_prev_post_lnk', 'comments_lnk'); ?> <ol class="commentlist"> <?php wp_list_comments('reply_text='.__('Auf diesen Kommentar antworten', $shortname)); ?> </ol> <?php __get_xTras('next_prev_post_lnk', 'comments_lnk'); ?> <?php endif; #== END if(have_comments()) ?> <?php if(comments_open()) : ?> <div id="respond"> <h3 class="comment_form_title"> <?php comment_form_title(__('Neuer Kommentar', $shortname), __('Antwort auf einen Kommentar von %s', $shortname)); ?> </h3> <div class="cancel-comment-reply"> <small><?php cancel_comment_reply_link(); ?></small> </div> <?php if(get_option('comment_registration') && !$user_ID) : ?> <p> <?php printf(__("Du musst <a href=\"%s\">angemeldet</a> sein, um einen Kommentar schreiben zu können.", $shortname), wp_login_url(get_permalink())); ?> </p> <?php else : ?> <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> <?php if(is_user_logged_in()) : ?> <p class="logged-in_desc"> <?php printf(__("Angemeldet als %s. <span><a href=\"%s\" title=\"Dieses Konto abmelden\">Abmelden »</a></span>", $shortname), '<a href="'.get_option('siteurl').'/wp-admin/profile.php">'.$user_identity.'</a>', wp_logout_url(get_permalink())); ?> </p> <?php else : ?> <p class="comments_inputs"> <input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" /> <label for="author"> <small> <?php _e('Name', $shortname); if ($req) echo " (".__('erforderlich', $shortname).")"; ?> </small> </label> </p> <p class="comments_inputs"> <input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" /> <label for="email"> <small> <?php _e('E-Mail', $shortname); echo ' ('.__('wird nicht veröffentlicht!', $shortname).')'; if ($req) echo " (".__('erforderlich', $shortname).")"; ?> </small> </label> </p> <p class="comments_inputs"> <input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" /> <label for="url"> <small> <?php _e('Webseite', $shortname); ?> </small> </label> </p> <?php endif; #== END if(is_user_logged_in()) ?> <p class="comments_inputs"> <textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea> </p> <p class="comments_inputs"> <input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Kommentar abschicken', $shortname); ?>" /> <?php comment_id_fields(); ?> </p> <?php do_action('comment_form', $post->ID); ?> </form> <?php endif; #== END if(get_option('comment_registration') && !$user_ID) ?> </div> <?php endif; #== END if(comments_open()) ?> </div> <!-- ============================================= END => comments.php ============================================= -->Ich bekomme es auch angezeigt, wenn ich es auf einem 2.9 WP habe. Ich habe in der lang Datei von WP geschaut. Demnach kommt der Satz aus der comment-template.php Datei aus dem Ordner wp-include.
Die Frage ist nun wie kann ich darauf zugreifen ohne an die Core datein zu gehen. Ich hab keinen Hook gefunden.
-
Moin,
ich weiss nicht ob ich die richtige Überschrift gewählt habe, weiss aber nicht wie ich es sonst schreiben soll.
Mein Problem: Ich erstelle mir gerade ein Theme. Dafür hab ich mir die Tesdatei für Wordpress importiert. Alles wunderbar. Ich will nun meine Post-Meta-Data mit Icons darstellen lassen. Also Kommentare, Trackbacklink und Artikel bearbeiten.
Wie ich das mache weiss ich, habs auch schon gemacht. Gibt es Kommentare wird eine Sprechblase angezeigt, gibt es keine wird eine Sprechblase mit einem Kreuz angezeigt und wenn die Kommentare geschlossen sind wird eine Sprechblase mit einem Schloss angezeigt.
Ist aber nun ein Artikel Passwort geschützt bekomme ich kein Icon mehr bei Kommentare sondern nur den Text "Auch die Kommentare sind durch das Passwort geschützt." Ich habe es hinbekommen das ich meine Sprechblase mit passwortfeld mit dazu bekomme, aber ich bekomme den Text nicht weg.
Hat jemand vielleicht eine ahnung wie ich diesen Text wegbekomme ohne in den Core Dateien etwas zu ändern??
-
Ich hab mir das Theme mal herunter geladen. Bei funzt es soweit. Hier mal der Inhalt der desk_functions.php
PHP
Alles anzeigen<? // Custom comment styling function confederate_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> <div id="comment-<?php comment_ID(); ?>"> <div class="commentblock"> <div class="gravatar"> <?php if (get_comment_author_url()) { ?> <a href="<?php comment_author_url(); ?>" title="Visit <?php comment_author_url(); ?>"><?php echo get_avatar($comment,$size='48',$default='' ); ?></a> <?php } else { echo get_avatar($comment,$size='48',$default='' ); } ?> </div> <div class="comment-author vcard"> <?php printf(__('<strong class="fn">%s</strong>'), get_comment_author_link()) ?> </div> <div class="comment-meta commentmetadata"> <a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?></a> <?php edit_comment_link(__('(Edit)'),' ','') ?> </div> <?php if ($comment->comment_approved == '0') : ?> <em><?php _e('Your comment is awaiting moderation.') ?></em> <br /> <?php endif; ?> <?php comment_text() ?> <div class="reply"> <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> </div> </div> </div> <?php } function confederate_trackback($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> <div id="comment-<?php comment_ID(); ?>"> <div class="grid_7 omega"> <div class="comment-author vcard"> <?php printf(__('<span class="fn">%s</span>'), get_comment_author_link()) ?> </div> <div class="comment-meta commentmetadata"> <a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?></a> <?php edit_comment_link(__('(Edit)'),' ','') ?> </div> </div> </div> <?php } ?>EDIT:
Hab noch was bei dir gefunden. bevor die 2te Funktion anfängt muss noch eine geschlossene geschweifte klammer:
-
Also die CSS Datei wird geladen. Die Styles werden soweit ja auch durchgeführt. Was nicht geladen wird sind die Bilder. Ich hab mir die CSS Datei mal angeschaut, und ich denke es liegt an den URL-Pfad den du verwendes. Versuch mal einen relativ Pfad zu nutzen.
Also statt: url(http://www.maler-munzert.com/wordpress/wp-c…hintergrund.jpg)
Probier mal: url(images/hintergrund.jpg)
-