|
|

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