|
|

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