|
|

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