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