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