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