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