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