|
|

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