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