|
|

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