|
|

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