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