|
|

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