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