|
|

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