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