|
|

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