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