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