|
|

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