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