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