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