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