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