|
|

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