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