|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////" Y i( x/ D$ i! ~
// Theme Option5 ~# k( M8 o r) g+ Z
////////////////////////////////////////////////////////////////////////////////
/ R4 K9 s7 o: ]; D+ m6 `; i) d8 t' \. B4 s
$themename = "Zenx"; q2 g8 X: o u5 `$ J- K# X
$shortname = str_replace(' ', '_', strtolower($themename));
) Z8 I( ~0 w S
5 q/ q+ t: y( {$ y, v3 N# _ jfunction get_theme_option($option)8 e, f0 z. T7 ?1 P
{# E, u5 R7 K( T
global $shortname;
9 d+ D+ V- t+ Q return stripslashes(get_option($shortname . '_' . $option));
3 e9 z% q G+ c. T4 G5 k, P}
* o9 ~( |+ ?, n+ b6 }6 a" M7 }: E* H: J$ Z" y8 |$ S
function get_theme_settings($option)3 C- q, L- w$ A6 m. `& e
{
! z! j" O( ~/ b) E6 h. E4 g return stripslashes(get_option($option));
1 i+ t7 }% I) _( e/ |5 ]}
1 h, A1 R8 P$ E+ v$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
" p$ C F! w, O4 w0 e* M5 y1 H$wp_getcat = array();
F! b5 ] ^3 g* lforeach ($wp_dropdown_rd_admin as $category_list) {
) |* J1 Q4 A; k3 M/ j: f$wp_getcat[$category_list->term_id] = $category_list->name;
- F2 c8 T. c2 g9 C}
$ _% _ M4 j' W2 Y( x$category_bulk_list = array_unshift($wp_getcat, "Choose a category:"); A( w$ R% H$ W* x
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
5 _/ W2 S& @8 ]( z5 E k5 ?$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
6 u, A. ]' }0 y8 G3 D5 c1 O0 B/ P# D; m8 T- |/ C
$options = array (; a. C. |/ W' v# W
! |( Q. s5 Z4 Q. P9 N
\6 ?9 u, [" O& o/ K7 I- l I8 l1 U array( "name" => "Blog Header Settings",
, r" u0 m0 M, U; d "type" => "heading",$ t9 N+ L" N/ l2 a' h6 V1 J, n: g
),
* O+ |; ], Y" I& u- |* u
! u4 T0 U6 L8 w- q2 ]$ B9 v array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",3 e" Y/ s* d) i: y1 o
"id" => $shortname."_header_logo_activate",7 z) I& b1 W6 ^; U8 Y y
"type" => "select", }8 K# Q( r4 h3 J+ {% N+ H3 G8 t
"std" => "No",2 o% S/ w) P, Q0 p1 o7 b3 z L3 _
"options" => array("No", "Yes")),- m3 e0 D S5 w! ?
2 y7 R8 i6 A3 T. _& ^& c
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",# B3 \* T) W' S1 c
"id" => $shortname."_logo_url",; U+ n$ Q7 k, Y
"type" => "text",' E( Y9 u% A- |2 u$ y
"box" => "social",
& k: X. N6 `# d: Z( c; b8 f "std" => "",: R# R# f( |- r5 k, Y5 n
),# v! |7 {5 v& K: e
& c5 ?/ \$ o3 R: y& p6 n+ i
array( "name" => "Insert Header Banner HTML Code (Header)1 u$ d0 x3 S0 j$ ^) _
<br /><em>*Recommended Size 468 x 60</em>
8 l/ y) u2 F; E1 m! T <br /><em>*leave blank if not use</em>",
+ f8 n. E+ ?5 L, F0 L J; I "id" => $shortname."_header_banner",
; G, O5 _6 B7 o "type" => "textarea",& w( t$ h% g- v
"std" => "",
W+ z7 \3 r7 h" |2 J- j6 u ),3 f7 P$ ]8 K6 I: v! |
" `+ k, K" a0 V9 _; g& D
array( "name" => "</div></div>",) B! p7 N D+ X h% K6 }
"type" => "close",2 x% b0 I$ E9 q
),, q0 o7 n( Q* i9 H3 p+ M8 j: k
0 Z8 X; @" J$ f) E7 [, D9 \- P3 s8 H: w+ N8 P9 [- R9 j
array( "name" => "Header Navigation Settings",
6 H' ?+ x O; w "type" => "heading",
1 C0 ~( k8 ]7 D/ l# z ),
; p+ p. j' {: G, N: U* E( q" H4 t! P5 ?) R
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
) c9 Q' [3 O0 v9 y: f9 G0 h <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />) A- V# J/ c; ~* o% s l, Z9 L, b
<em>*Enter the page post ID number only</em><br />
, d& w2 X) ^+ b0 |7 d <em>*separate by comma</em><br />% s0 S# _5 _' D' _' @
<em>*Exclude pages which you don't want to show on the header navigation</em>",1 q; f8 |# s% c0 y6 C( A
"id" => $shortname."_header_page_navigation",
" |. ?& S8 R: M" e. l "type" => "text",9 C# m. _1 S( a# J1 x* a2 e; W: n: O; K
"std" => "",
5 `# t! ?. W! P6 Q/ } ),
* o+ b5 ]$ v5 r, b4 `, y
$ t) {2 K6 e! Y2 \! n* |6 D# V array( "name" => "</div></div>",# }' r) E& M I- D+ p% N
"type" => "close",
; x' q# c7 S! h: d- w ),
/ I. }: G! ]) `8 e
" _3 O. ?& I; m' y, |' X$ x! s' p3 y# l
I' @/ d* n& v9 h+ [6 h array( "name" => "Post Auto Thumbnails Settings",8 k1 f) g- L8 ^( j- V' P3 N; r8 m
"type" => "heading",
6 U- e7 Z) E7 D+ M3 v4 \" f4 w% a ),' j+ z( b% r/ B1 Y
- ]% ], ]' c8 G' X: a0 z1 g) T6 \$ G array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
4 d$ _* z4 E* e. H9 g( N$ @ "id" => $shortname."_timthumb_activate",
- n& R6 B6 I: V4 {' \, k "type" => "select",
+ r' m& k" p7 z! E "std" => "No",
7 |8 h$ ^2 D8 v9 j5 j, \, ~/ { "options" => array("No", "Yes")),1 K& f+ N! P4 s) v; u) _
9 ]2 M; Z1 {3 i5 H0 n3 k
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
1 C# f f- \9 D: B4 K9 ]2 q# I "id" => $shortname."_timthumb_cropping"," m5 M# Y' P: j2 D, D
"type" => "select",
7 Z, R/ G( O; s. [% y, r: ]. U "std" => "",
0 x" ?, {2 r- T- t# d "options" => $crop_position),
6 x7 A: Q" v# Q% S
+ W/ ^. A( A0 h8 j array( "name" => "Insert Width Of Thumbnail Image<br />
; t) k8 x! {! {7 h$ v/ o <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
7 n c3 N9 H4 P0 X6 u <em>*Leave Blank To Use Default: 250</em><br />",
+ m# `2 z& I+ g+ X8 f1 |2 D9 a* S6 s; } "id" => $shortname."_thumb_width",1 ^9 c# Q" _) {1 r
"type" => "text",2 a: {1 }+ f1 J# T R
"std" => "",6 I1 `" S8 U3 P: L2 c: d
),8 N0 t# e5 ]: i1 r; q/ K
6 D8 Y! x! G, E$ `' w
array( "name" => "Insert Height Of Thumbnail Image<br />
. F% q) b/ F, x, B <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
5 f( L" L1 |$ p' z% s5 C <em>*Leave Blank To Use Default: 200</em><br />",5 [8 P/ m! c5 {: M; f1 \
"id" => $shortname."_thumb_height",
% M+ L$ c a" q9 |1 `: I "type" => "text",- H6 ]# U+ S0 k! [; s
"std" => "",
7 ?' W9 O" r9 c, H ),
7 F. v; H) A+ _$ C i9 J
! y+ C/ o6 c, y array( "name" => "</div></div>",) ?2 ` u4 L7 L7 v6 V% h) I1 ~
"type" => "close",& [6 X/ ^1 G2 x( _9 e
),/ o2 f$ q! Y& C8 K: w" J% K
. G/ ], d$ X9 k array( "name" => "Featured Content Slider Settings",
$ k% X$ P* S, |( e2 n6 @9 k. f "type" => "heading",/ N& P8 R! a9 Y2 Q* ?
),! P1 B+ b% {1 i" d4 k9 E! s2 e, ?
% y6 I, ^+ _, \0 z, n N( A array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",4 g. [9 p: X% D9 V+ T, R* W- f
"id" => $shortname."_featured_activate",; R! _% l& B3 |) J- r; M% o6 m
"type" => "select",
* x2 Z# {2 K- E/ T6 X5 ]9 g; A "std" => "No",. ?5 L' K. }; [. K! I, G _
"options" => array("No", "Yes")),
! p+ f) Y+ w5 D) l+ F3 L
9 ?- T- S2 l4 q5 X4 b/ o: \" O7 Z' S
! E6 Y* s* ?9 u0 ^5 a7 v7 O array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",, W! J" f0 g- l. i' D1 h
"id" => $shortname."_featured_category",! z4 I) c! M; s# L0 K$ s2 `4 w, ?3 u
"type" => "select",3 \7 U) H \5 I7 j$ { ?
"std" => "Choose a category:",
n! i: k& m4 G7 {/ R# b, _9 X "options" => $wp_getcat),
# Z( s3 M) S( x4 M$ R
' ^0 _( U6 m# B7 @% y array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",7 }; j' [- p# I7 Y* C+ w% c
"id" => $shortname."_featured_number",1 h; \* B( z1 W, Z9 c" K
"type" => "select",
+ L' O3 W! i6 H! p/ l "std" => "Number of post:",
% p2 B1 O6 e, M5 b' w3 X "options" => $number_entries),. M$ ]6 T( e( w( e- L
1 n( A. Y" w9 X/ G2 D array( "name" => "</div></div>",9 O: F! m. e v* P( T: G
"type" => "close",
' T% Y8 M9 r# b$ m! [ ),% E7 c j1 g; [$ i% K) g
3 `& b: ~2 D, U3 l; U
array( "name" => "Featured Category Settings",
# |) B5 V# h4 ` "type" => "heading",5 ]7 r3 i! V* z! ]" Z7 q; Y/ ]- h
),$ S7 P% O1 a. `
9 r M8 Y- x, ?8 i1 [ array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
3 S2 P( w. Q+ B "id" => $shortname."_featured_category_activate",' B- ^8 _. B Z1 u9 w
"type" => "select",
3 ^( U, V6 U0 m" {- U( U( J "std" => "No",4 c# Z5 E4 ~. X3 ?5 Z# D( B; E
"options" => array("No", "Yes")),
' o8 C% T& Z0 R # e; C; B7 t' E8 z* h- t
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",3 I2 h3 s: i/ d6 k, f
"id" => $shortname."_featured_category_id1",
, x$ [, U. H5 ?3 T1 ` "type" => "select",5 L9 x' h1 F. o8 E
"std" => "Choose a category:",! M0 M; c4 c! g+ k% K$ k2 p, r/ s4 \' w
"options" => $wp_getcat),
1 A1 j: C3 Z0 r9 Z
, E4 b" D) T, e1 H6 w3 ]+ ^7 l array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",$ A% W& w* H: {$ a# Z! b7 U
"id" => $shortname."_featured_number1",0 T1 i1 W+ C' K. |
"type" => "select",) f0 u/ l1 e: ~$ W/ o
"std" => "Number of post:",
. m5 G4 c: o: {! x: h" n( e "options" => $number_entries),5 e8 _7 H3 ~ C1 F9 W* \. h& x) k
6 }9 |( X: ^' \' s8 [$ C
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
9 F/ g3 R: ^9 f2 N "id" => $shortname."_featured_category_id2", i7 @' z$ ]! I9 }+ T$ ?9 {9 X8 C
"type" => "select",0 K6 q$ s# o- W% S/ m9 i- E
"std" => "Choose a category:",
0 J+ W: S: l# b" w2 k$ x5 @; N "options" => $wp_getcat),
# S; Y0 }0 E( {( j6 Q0 c
: z" N. Y5 i( S+ ` array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
! p$ o5 o9 \( { "id" => $shortname."_featured_number2",/ r4 `% O4 D! h4 R' T
"type" => "select",6 H. \0 l% m! z: J& O: A( t
"std" => "Number of post:",
7 J L' u0 {) p- z6 z$ t "options" => $number_entries),
$ K" {3 h$ h' q" | ; Z5 ~% p2 q( h( n+ p/ f
; B. y% P/ E; P6 }1 \
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
& p8 V/ N2 |5 ? "id" => $shortname."_featured_category_id3",& m- @% P! i2 ?+ _/ ~! C
"type" => "select",/ F) C5 [; ~9 g K$ Q- q
"std" => "Choose a category:",4 }% H6 R" c0 m$ c2 X+ T! c
"options" => $wp_getcat),
# J" L1 i0 A. S" F0 N" |8 K$ v
: h, o2 k6 d9 \ array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",7 X. u: b0 Y# _- X1 B
"id" => $shortname."_featured_number3",
7 ?; [& {! {0 o "type" => "select",
- L& h. {4 g' k9 w "std" => "Number of post:",
8 g5 ?/ L6 g5 o! Z- {5 f "options" => $number_entries),5 s* O6 g, ?' ^
5 j! w$ k# h% L/ l; R
' f' D5 {" |& W% H, f2 G
array( "name" => "</div></div>",- P" F/ ?0 w7 c$ r+ ], w
"type" => "close",& W+ L0 K; w/ d4 e. `. b- Y
),
/ L* O7 B: M$ e( S! q
* y8 _- w) o) p& t) ^0 k6 T% h5 c, J& t5 r/ u# b
array( "name" => "Google Adsense & Analytics Settings",& k- V9 Z1 h1 [& [$ [" a% w' x
"type" => "heading",5 M+ y! N g1 Y5 Y
),! R: ^/ ]8 ?9 q" Y, z+ k5 [
2 x( Z' y$ B) b" D
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",/ m/ @! t- u% }3 M3 p# X
"id" => $shortname."_adsense_loop_activate",
* J# q! U8 D2 G! I9 d2 Z "type" => "select",% g8 J" B0 p: R
"std" => "Disable",% v2 }0 w& g0 a: N
"options" => array("Disable", "Enable")),* b) h4 }4 g8 }3 o7 b p0 q
- N ~2 e' j( F array( "name" => "Insert Google Adsense Code For Loops Here<br />( z$ A" O3 ~+ [
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
- Y$ F0 @# P0 z2 ~; p! k "id" => $shortname."_adsense_loop",/ S H( N/ Y0 L+ Y% c) e
"type" => "textarea",6 L8 g9 ^- X2 s' r/ T' g% k
"std" => "",
9 x$ i) j" v$ S& E3 S N ),/ n5 D! m* @ S6 p9 U ^. T% q
1 F: b+ C: d8 E+ ?6 E" ^
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
9 h* e" h, u! q" y8 @. x$ o. A$ y) ]; Y "id" => $shortname."_adsense_single_activate",6 Y( Q9 ], g: {, ~$ h
"type" => "select",
" s' n* J- \2 D2 [. D- \( ^+ U) ] "std" => "Disable",
0 r! N5 R% k( O2 w7 j "options" => array("Disable", "Enable")),7 U6 o0 u% ~4 l: i8 k h
& D/ o+ F W" K' n1 n( H6 T4 \
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
) f! C* i0 Q1 h1 e( [ <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",' V3 m7 x: V5 D/ D+ J( x0 H; l
"id" => $shortname."_adsense_single",
9 [ @" @9 `9 v' f" J "type" => "textarea",
- w7 n7 _: l, f8 A: h$ b. w "std" => "",& N7 _% t/ B$ u3 P. J. R0 E; Z0 r
),' y i7 w a& {: C) r/ g5 q# {
' @7 r; |7 p) u6 K( S! z" `/ z
2 _5 ? \; Z6 e! Z) l6 m* t array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
9 @' g; T+ ^0 {$ I "id" => $shortname."_google_analytics",
3 }' @$ ~; F' {4 V1 S* x "type" => "textarea",
* I( q0 g0 E# F7 t; F "std" => "",
# ^% v5 X& k# c ),
: R1 n1 N1 @6 b
* g* [# J9 w0 i3 `- ~5 f, F array( "name" => "</div></div>",& i/ a/ e5 ~- C2 U& y& c! B' M
"type" => "close",# [* w, \- Y9 @0 m9 @) l' U
),
) u0 h. W! A" n/ z2 G5 X- q 0 Z$ Z+ q' d% x: \6 Y
" `; S( u$ d% x- M# r" [' Z+ N$ O0 T
array( "name" => "AddThis Social Bookmarking Settings",
- d0 c& L& a8 E+ X: A "type" => "heading",
; w6 f8 l7 g! ]2 N ),
4 v' T( J V& F" U" l$ R; t/ ^
. ?! B0 ~* `, m6 i* A array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
8 W# C; s( @) u! i. |) c5 U <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
* B4 T; p: T- N. p( h "id" => $shortname."_addthis",
7 H( h3 d0 G6 F. t "type" => "text",
. U, H$ n# _; s/ f9 Q8 M+ J5 j "box" => "social",
# u' v) v; o G "std" => "",' u, }8 W% B& ^$ g# U$ A
),
" m9 _/ ?$ ~1 s, i0 ~" g- M- K. q, f2 J% E; n
array( "name" => "</div></div>",2 Z) e# L& g1 d. H* s
"type" => "close"," y2 m1 ]) b" C8 g( {+ U
),
( P c" Y4 Z6 |7 z- v& q x$ V& b; n! S/ Q
" r0 e3 n' }+ r9 h/ R: ?0 c
2 _" @5 h7 Y8 H0 B3 _3 q array( "name" => "YouTube Video Settings",0 j- o3 [9 |8 d
"type" => "heading",9 g( ^; n: f8 q+ }1 v
),
# y" q3 L7 \* u9 M; p
4 D* y- \- V5 w+ C2 }9 ?- h array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",$ w b, r3 e4 R0 M/ o4 J! [
"id" => $shortname."_emvideo_activate",' r. e7 _0 |7 a& K/ w
"type" => "select",9 \- O' D( L# N. h
"std" => "No",
+ ]$ c/ S z" Y "options" => array("No", "Yes")),3 [+ U; n9 d9 f+ ~4 W8 q0 r
: E ~/ A4 d5 T3 i! u0 [) E+ f" Y
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",) g5 B2 ~5 i) Y5 s
"id" => $shortname."_emvideo",, O U, Q3 @4 ]8 e9 X. U. y: m
"std" => "",2 C0 Z' j' O. c7 e" C& f, C3 y
"type" => "text"),
. r% q e, q3 O6 T8 _
: e2 M5 U. h( B# p! z: t% D array( "name" => "</div></div>", r9 H3 f. Z1 \, h4 P" P5 w
"type" => "close",
7 a$ p& g7 L+ e& `2 P* [9 X ),
* f) {' l0 D" J: ], m/ [ 6 B) _9 C, k% D2 R4 u; V) y1 Z% T* _
array( "name" => "Twitter Settings",
6 j& B4 _9 V: Y* V "type" => "heading",
0 C2 M8 S! [ _ ),
7 s8 S9 D4 Q, r) m5 O. l: Z: y- I: Q+ f
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",' _8 u+ y. y) ^% e( k
"id" => $shortname."_twitter_activate",
; Z8 t$ h" L: O! t* \' P "type" => "select",! u+ d8 F/ J' G8 {8 U7 B2 z
"std" => "No",
5 u" k& F" H$ z6 v5 g "options" => array("No", "Yes")),& F$ V; ]9 o+ r/ o
* j9 s8 c# ]: m4 f6 A( N
array( "name" => "Insert Your Twitter ID here# R. `' \3 T+ {( t" ~& M
<br /><em>*leave blank if not necessary</em>% D, E2 b. i1 X2 i: l( R$ f
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",5 L! q+ \3 a& T8 R7 a& K; G2 C
"id" => $shortname."_twitter",+ H3 X+ D' z/ x0 k8 s* ?0 ^' y
"type" => "text",
! d! j% F) X( I0 h "box" => "social",
: b# c9 c4 E( z3 o "std" => "",
+ o/ t1 }6 f/ |$ Y1 h. |" D ),
) ?8 ]: `; b$ z7 L' q0 E- Y, l5 f$ M, |# C
array( "name" => "Enter Twitter Feed Count here$ d: B' J2 K5 n7 k8 ]0 h" z
<br /><em>*leave blank if not necessary</em>
. V' S! m5 y/ g2 e5 V5 [. _4 g <br /><em>*Enter How Many Twitter Feed To Display</em>", t1 W. M; P/ W8 ~) ^9 A$ ]- p! C
"id" => $shortname."_twitter_count",6 C, u( ~' ]% v7 j* @ G
"type" => "text",# ]0 d5 ]0 C3 u, T
"box" => "social",# z2 \8 N9 `, F
"std" => "",2 f9 R: W+ R/ u% _9 p3 g
),
$ Q% Q' M3 R& y- A( ^% {
* m8 `) a D. ~! G4 I1 y0 M array( "name" => "</div></div>",. o( |% Z C( q
"type" => "close",. Y7 N* y. D7 o* I4 I# l o7 k- v
),1 K. M% Z$ l6 l1 w' Z5 S
" j# J0 L# [, J6 X3 H2 F
7 X, f5 n5 Y& T$ D2 W% `% G
array( "name" => "125 x 125 Banners Advertisement Settings",% u7 Z, d" z0 c6 K) q2 C
"type" => "heading",% D7 _* a! I% j4 p4 J
),
3 }% _/ r! W, t/ T7 H; [% m
5 S& Z( ]2 r7 @& l8 g( J. i+ [ array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",8 E' a# {# s" w3 \$ i1 ~% {( d
"id" => $shortname."_sponsor_activate",2 c8 w6 ^0 R X0 q
"type" => "select",' S R( M4 S0 I
"std" => "No",
# |8 j' i* S/ @& R "options" => array("No", "Yes")),# \9 X6 ]0 W& ^* T g
. Z7 l0 ~9 M3 U2 T4 L/ K0 i; y$ d, g9 a) y$ g
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
% h3 e) i8 Q. Q5 k8 A6 N "id" => $shortname."_sponsor_banner_one",
$ r0 z* Q9 D! J5 Y5 r1 `* ~( ~$ u3 l "type" => "textarea",
3 v: `" P4 k# A0 o; B) O% m$ \ "std" => "",
7 U$ }' B8 s$ z9 R+ Z ),
! A5 h X0 w# m$ Q5 @% P7 D( V0 [# J( d- f: ^+ F5 D4 t* [
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
. \# C7 g) X) u# c6 S: T' P& { "id" => $shortname."_sponsor_banner_two",7 W7 t2 q3 C) p" [+ F2 \9 X" V6 \
"type" => "textarea",
* W" X3 Z- q! d, l( G( N "std" => "",
/ {: z# `. D9 d2 x; i, u/ G ),: i) B$ `! Z9 N5 L
- B* w, |! q( z5 }8 _. e& w
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
& E! G& L4 Z/ v+ ] "id" => $shortname."_sponsor_banner_three",
! T4 X- u- c' L1 w. A "type" => "textarea",
- p- R5 k d7 Q( q! ?1 g( g% B5 i) ? "std" => "",
( O' }# g8 }6 z! N% ^ ),
1 U! W/ e5 s* L p w u4 c2 ?( Y" L6 ^8 x$ t
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
! ~$ Q& y' z5 s3 |* z$ x( | "id" => $shortname."_sponsor_banner_four",
- f9 m" L* N$ p# u9 J2 `: u: L "type" => "textarea",( r5 C/ W6 `# O m; e
"std" => "",1 n$ q8 o8 b, A% i8 M3 ~
),+ e! g0 S" ~0 |
8 C$ _- S# }/ g; y array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
2 P, }' j# c" y' {) c "id" => $shortname."_sponsor_banner_five",. B) t& }& R% {6 |
"type" => "textarea",
( [% y& A% i0 h0 g# [. o# A "std" => "",
4 o* g1 Q- i( @. A7 u ),! T' w' W4 v& B0 q7 Z
: h- `8 c5 M3 r+ f0 [( L0 w
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",0 n1 C3 i0 D* i* e h" ~
"id" => $shortname."_sponsor_banner_six",$ h ]. U G" D0 w7 H1 S R
"type" => "textarea",
3 g, b. Q2 e! { "std" => "",% O# I& _; { {" l* S
),% Q3 _6 O( p* i6 [ r8 `
2 i3 v ]1 h) O. D2 z& y3 L: s
array( "name" => "</div></div>",# p# H9 C4 v$ T5 Q: p
"type" => "close",
- {' E2 `! | B' H/ Y I2 j$ D, f! h ),
! S* E, q( X# t4 [# Q
0 d, g/ U" S% J7 r) e7 H- f7 m" D9 e( U( _0 Z2 c# |# V
1 K- e3 m! E3 ?, v6 `);/ m7 u9 K/ x0 A% ], a
5 v9 L3 A' o! P! Z7 m1 g, I
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
& s+ f3 i; X0 Q5 f8 p
% Q* p5 X# Y( o* z8 K; Recho "<div id=\"admin-options\"> ";
+ }& J$ ^ C, r$ S! o: k7 f' f) _4 D3 J% k z0 x! a
global $themename, $shortname, $options;8 [+ Y1 v, {7 P7 s
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';, T! @6 o, P) ` u
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';& M* J4 ?, K4 w5 Z( L
?> Y- ^# G2 P: }7 L
4 P* g5 d: b( d+ B0 J$ d3 m<h4><?php echo "$themename"; ?> Theme Options</h4>
4 L1 Z' m- g5 ^# G- R
+ a9 b% K# q6 r# a$ V- G<div class="annouce">
% O+ k+ _; ~4 g* `. P. c<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
0 F4 o% _! L/ f. R" x9 i<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>0 ~: S; D$ D2 l/ ]
</div>+ p! a) e+ x# A1 f
+ L1 @& e0 \8 Z, a6 c<form action="" method="post">7 o$ s. H. k% g' M7 i) T$ b
' t, s7 u8 K3 X. Z$ X<?php foreach ($options as $value) { ?>
1 H8 l3 j: a) ]- q$ v
* H* O( R' v9 I w, P5 {! W<?php switch ( $value['type'] ) { case 'heading': ?>. A5 \3 A% r, x1 I- o
5 `8 \( N0 {9 j: K<div class="get-option"># ?8 ~1 f/ O7 _$ |! c1 T
5 H- H a/ v" o5 p
<h2><?php echo $value['name']; ?></h2>
) H% k4 d$ W9 p$ S) A2 h$ z, O, K/ y9 C! \9 t8 M# Y# Y
<div class="option-save">& L2 N9 L) g/ D, d8 F
5 O! {( f# w6 {3 {) M$ D" v' }
<?php( {4 x2 K+ q) l, j
break;
" C1 v- y: s7 ]" v) u, R" B. a6 jcase 'text':
7 N- r! n6 [& O- ]& j, P, |) M?>4 v B7 h3 g: O) J# U9 a/ T
6 f' m$ j2 r3 F' J
<div class="description"><?php echo $value['name']; ?></div>
L. S* z+ ~2 f7 X& L/ F$ I<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
( t1 g6 g) S9 S/ u' f9 ~# j. d/ c( S' s7 R: a8 E
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>0 i6 C) M' o$ V4 n8 l6 P
' P& f0 ^( T% f6 t: \3 {
<?php
& n& q% K$ Z4 f7 \, D) C2 t( xbreak;+ j( }- n4 ^. k& {0 `5 d" o5 I8 ^) C
case 'select':6 g2 Z3 G4 x/ V& ?
?>: {/ ?( A9 n- a6 ]8 v' _
. ~2 X1 Q- l+ E7 t' g9 }1 N8 i
<div class="description"><?php echo $value['name']; ?></div>* s9 w% ]8 U5 n) e( i
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">3 W9 Y; Y# c3 ?3 A
<?php foreach ($value['options'] as $option) { ?>
* f# `& B6 c* h% [" D; J; D4 N; c<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
- J2 V; B$ B/ B2 h" W+ H* q [& N<?php } ?>
6 l1 E2 s- \/ f1 I, o! F# ]</select>
# B7 n; ^# l) D. z6 k</p>
2 P+ ?7 B5 {. V2 e+ p; a4 _; |. c" S
+ u" y7 x$ q# }. t% x<?php% u# k% W0 v5 H! ]7 p
break;
: _! j$ A( w* x6 g) N: acase 'textarea':) M0 s0 U9 |$ e
$valuex = $value['id'];
# X% l c1 A9 N7 Y: P$valuey = stripslashes($valuex);
8 n8 j P5 t$ N! ~1 b9 s' v$video_code = get_settings($valuey);' e8 a: ^) F6 K6 `1 N5 B5 S+ U
?>
: I8 ?* x* |" k2 C6 q3 J. P; p. p
<div class="description"><?php echo $value['name']; ?></div>
* R) |; J p$ ^; R7 q) Z( P<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
$ L' P" F1 n( a$ W; A1 j
! i3 I- c7 G; _; k2 g: e$ Delse { echo $value['std']; } ?></textarea></p>
( ?: x+ \% o1 k0 @8 }4 R1 M* H: ^
<?php
' Q8 w% W* q" x' q6 Vbreak;' R$ f5 }( g0 l# r* \1 n& z4 }
case 'close':
: P& p9 X( v* @3 H9 E$ g?>
$ U# v% x% o1 p6 s5 v! ]
$ s( y2 z: C; X5 H9 Z$ I, y<div class="clearfix"></div>
( y+ R0 |* R& c2 `4 Z</div><!-- OPTION SAVE END -->
8 L' O5 @# I" f( I7 m' D
& ~' N" `8 q6 g2 |4 D+ A" t$ j<div class="clearfix"></div>8 c. f/ _9 a% P/ a0 z
</div><!-- GET OPTION END -->1 h+ g1 |( Y& l* e: B
" I( J7 ~/ y7 ?6 U2 V- @2 w# D
<?php2 D$ K$ r D* a' r$ X
break;
- h" Q1 k* M8 ^) Z$ {+ y( @# gdefault;
/ L9 l# k$ w. X, Q?>5 S0 R! X# t- n
" ?- w- i0 q4 l8 e+ Q# e( x# \, _
4 E! Q2 m' I# H# R" E7 u& h<?php6 v0 t1 l; b6 s* k& I( _ n6 s
break; } ?>2 Z4 J' l+ @% a" {1 ~! K
! t; | |4 U. s1 i3 N! Y% K<?php } ?>/ G: u4 j0 j- B. ?
* t$ g9 R: D/ S# Q3 v6 T
<p class="save-p">. E7 z# ]4 y/ v% U- S; k
<input name="save" type="submit" class="sbutton" value="Save Options" />
' T! S( h' l. Z& {( }<input type="hidden" name="action" value="save" />
+ t. }3 S2 ~! l0 `; \, _" M</p>
' H2 F" ?1 G% T3 U</form>0 H/ |8 X U# ~" U; T- U
& Q1 w% R" L; n6 W' U% d
<form method="post">
7 w2 ]9 Q( ?) O2 _! t4 r4 h<p class="save-p">
! X9 j9 u# `4 D) X<input name="reset" type="submit" class="sbutton" value="Reset Options" />$ y1 W# W y3 b2 [2 {- S
<input type="hidden" name="action" value="reset" />5 S# B+ k( U1 f1 [* r9 s" \' z* ]
</p>
. s2 S; a, L. }2 S' T</form>" W, `" X$ q- q- z7 H( m
9 R; |2 y6 c, a4 B D* o6 i</div><!-- ADMIN OPTIONS END -->0 q/ t4 j; }" E( l) z, I) m% s( A
8 c* B) C$ ~7 a {8 W k<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
0 j& c' X# a/ T: k% F* _2 n
. y1 A# w6 S0 k8 R, s: p% \# v( vfunction mytheme_admin_register() {
, B+ ~! j4 J" ~" e* Z0 W: Eglobal $themename, $shortname, $options;9 @) n/ k0 @7 g1 l! N: E* `# b
if ( $_GET['page'] == basename(__FILE__) ) {/ b/ H+ M L2 c. Z# i( d7 n
if ( 'save' == $_REQUEST['action'] ) {' M( h9 \$ c; r2 y$ _! N' J! x
foreach ($options as $value) {) K' V; l3 T* R0 H
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }- ?& f: c9 Y- P$ O# d
foreach ($options as $value) {( b- m+ W2 ?5 d5 M7 L
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }$ A8 n! s2 _8 x
header("Location: themes.php?page=functions.php&saved=true");
6 K# t6 e, J5 _die;, d6 G" ~1 e& L- l' ?- Y
} else if( 'reset' == $_REQUEST['action'] ) {) Q* q* N' Z: Y( ^
foreach ($options as $value) {
) X8 Y$ L( {5 ?0 B7 Xdelete_option( $value['id'] ); }& _1 Q. {. N# f! S, v" @. W
header("Location: themes.php?page=functions.php&reset=true");
% ^) }* P: D( _1 A0 udie;
$ u, |4 C! {# v4 A}
$ C1 d8 Z3 k n& M}% N& c- }7 b, P! n0 e
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
; [* h4 c; I6 Y" K# H* E z}
+ v9 v6 X+ F8 A: s" f0 a! Q& W+ V2 c8 u# y# n
function mytheme_admin_head() { ?>
! o7 @4 F6 Y1 A2 i$ q$ w<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />" F+ i _; x0 C8 x" Q1 o
<?php }
/ F) z' ]- R6 Q) \; s |
|