|
|

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