|
|

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